diff options
Diffstat (limited to 'dumps')
-rwxr-xr-x | dumps/fetch-dropbox.sh | 3 | ||||
-rwxr-xr-x | dumps/fetch-local.sh | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/dumps/fetch-dropbox.sh b/dumps/fetch-dropbox.sh new file mode 100755 index 0000000..99db29e --- /dev/null +++ b/dumps/fetch-dropbox.sh @@ -0,0 +1,3 @@ +#!/bin/bash +dbxcli ls -l "${LIGA_DROPBOX_DUMP_FOLDER}" | awk -F"ago" '{print $2}' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | + xargs -I{} dbxcli get {} dumps/sync 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 |