Skip to content

import window #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions run_airline_ontime_import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
# looking for csv files in this dir
FILES_TO_IMPORT_DIR="/mnt/nas/work/ontime"

# limit import to this number of files
# how many files to skip from the beginning of the list
FILES_TO_SKIP_NUM=0

# how many files to import
FILES_TO_IMPORT_NUM=3

# which file would be the first to import
FILE_TO_START_IMPORT_FROM=$((FILES_TO_SKIP_NUM+1))

i=1
for file in $(ls "$FILES_TO_IMPORT_DIR"/*.csv|sort|head -n $FILES_TO_IMPORT_NUM); do
for file in $(ls "$FILES_TO_IMPORT_DIR"/*.csv|sort|tail -n +"$FILE_TO_START_IMPORT_FROM"|head -n "$FILES_TO_IMPORT_NUM"); do
echo "$i. Prepare. Make link to $file"
rm -f ontime
ln -s $file ontime
Expand All @@ -22,6 +28,9 @@ for file in $(ls "$FILES_TO_IMPORT_DIR"/*.csv|sort|head -n $FILES_TO_IMPORT_NUM)
-u root \
airline ontime

#--local reads files locally on the client host, bot on the server
#--lock-tables Lock all tables for writing before processing any text files. This ensures that all tables are synchronized on the server.

echo "$i. Cleanup. $file"
rm -f ontime

Expand Down