diff options
author | emkael <emkael@tlen.pl> | 2023-10-07 21:23:45 +0200 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2023-10-07 21:24:46 +0200 |
commit | a6ca0fa635e3a3816f9f11d529f22f4896b3bae7 (patch) | |
tree | 793a86b5984f4dfe113624b236e6827e587b7ed7 /dumps/fetch-local.sh | |
parent | 56a6344d74670bbc30c476bde91a11d36c6b1b43 (diff) |
Importing dumps uploaded via Dropbox and FTP
Diffstat (limited to 'dumps/fetch-local.sh')
-rwxr-xr-x | dumps/fetch-local.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/dumps/fetch-local.sh b/dumps/fetch-local.sh new file mode 100755 index 0000000..01616a7 --- /dev/null +++ b/dumps/fetch-local.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +find http -path */spedytor/*.sql | sort | uniq | cut -d/ -f 1-4 | uniq | while read LOCAL_DUMP_DIR +do + LOCAL_DUMP=$(find ${LOCAL_DUMP_DIR} -name *.sql -exec ls -t1 {} + | head -n1 | cut -d' ' -f 10) + TARGET_DUMP=$(basename ${LOCAL_DUMP}) + TARGET_DUMP=${TARGET_DUMP%%-*} + cp "${LOCAL_DUMP}" dumps/sync/${TARGET_DUMP}.sql +done |