summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-ximport/photobox_import2.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/import/photobox_import2.sh b/import/photobox_import2.sh
index 4492fc6..c84d752 100755
--- a/import/photobox_import2.sh
+++ b/import/photobox_import2.sh
@@ -1,11 +1,9 @@
#!/bin/bash
-readonly backup_root=/tmp/backup
-readonly pending_root=/tmp/pending
readonly photoregex='.*\(jpg\|raf\|cr2\)'
-#readonly backup_root=/btrfs/staging/import_tmp
-#readonly pending_root=/btrfs/storage/pending-photos
+readonly backup_root=/btrfs/staging/import_tmp
+readonly pending_root=/btrfs/storage/pending-photos
readonly input="$1"
make_unique() {
@@ -39,6 +37,8 @@ readonly pending_path="$(make_unique $pending_root/$(date +%Y-%m-%d))"
fi
echo "Deleting original files"
+ # Prevents 'rm -rf /'
+ echo rm -rf /media/"$(basename $input)"
rsync -Hvax --remove-source-files "$input/." "$backup_path/."
echo umount "${input}"
) 200>/tmp/photobox_import2.lock | systemd-cat -t photobox_import