Skip to content

Commit e6bd479

Browse files
authored
Merge pull request #44 from sunsingerus/master
import window
2 parents dbfa7ec + b0db872 commit e6bd479

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

run_airline_ontime_import.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,17 @@
44
# looking for csv files in this dir
55
FILES_TO_IMPORT_DIR="/mnt/nas/work/ontime"
66

7-
# limit import to this number of files
7+
# how many files to skip from the beginning of the list
8+
FILES_TO_SKIP_NUM=0
9+
10+
# how many files to import
811
FILES_TO_IMPORT_NUM=3
912

13+
# which file would be the first to import
14+
FILE_TO_START_IMPORT_FROM=$((FILES_TO_SKIP_NUM+1))
15+
1016
i=1
11-
for file in $(ls "$FILES_TO_IMPORT_DIR"/*.csv|sort|head -n $FILES_TO_IMPORT_NUM); do
17+
for file in $(ls "$FILES_TO_IMPORT_DIR"/*.csv|sort|tail -n +"$FILE_TO_START_IMPORT_FROM"|head -n "$FILES_TO_IMPORT_NUM"); do
1218
echo "$i. Prepare. Make link to $file"
1319
rm -f ontime
1420
ln -s $file ontime
@@ -22,6 +28,9 @@ for file in $(ls "$FILES_TO_IMPORT_DIR"/*.csv|sort|head -n $FILES_TO_IMPORT_NUM)
2228
-u root \
2329
airline ontime
2430

31+
#--local reads files locally on the client host, bot on the server
32+
#--lock-tables Lock all tables for writing before processing any text files. This ensures that all tables are synchronized on the server.
33+
2534
echo "$i. Cleanup. $file"
2635
rm -f ontime
2736

0 commit comments

Comments
 (0)