Skip to content

Commit 9b10412

Browse files
committed
2020-12-10-docker_backup.sh folder fix
Dropbox are about to change API versions and discontinue the current API's in 2021. The developer of Dropbox-Uploader has updated the project, it seems for this reason. The default way the files are saved has been changed, hence this PR is need to fix that. You will need to create a new dropbox_uploader.sh config file if not sone already ready for the discontinuation of the old API. https://github.com/andreafabrizi/Dropbox-Uploader Also updated Dropbox file retention to 30 which is more useful for restoring after an un-noticed issue.
1 parent 416091c commit 9b10412

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/docker_backup.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,23 +63,23 @@ if [ -f ./backups/dropbox ]; then
6363

6464
#upload new backup to dropbox
6565
echo "uploading to dropbox"
66-
$dropboxuploader upload ./backups/$backupfile $backupfile
66+
$dropboxuploader upload ./backups/$backupfile $dropboxfolder/$backupfile
6767

68-
#list older files to be deleted from cloud (exludes last 7)
69-
#to change dropbox backups retained, change below -7 to whatever you want
68+
#list older files to be deleted from cloud (exludes last 30)
69+
#to change dropbox backups retained, change below -30 to whatever you want
7070
echo "checking for old backups on dropbox"
71-
files=$($dropboxuploader list $dropboxfolder | awk {' print $3 '} | tail -n +2 | head -n -7)
71+
files=$($dropboxuploader list $dropboxfolder | awk {' print $3 '} | tail -n +2 | head -n -30)
7272

7373
#write files to be deleted to dropbox logfile
7474
sudo touch $dropboxlog
7575
sudo chown $USER:$USER $dropboxlog
7676
echo $files | tr " " "\n" >$dropboxlog
7777

7878
#delete files from dropbox as per logfile
79-
echo "deleting old backups from dropbox if they exist - last 7 files are kept"
79+
echo "deleting old backups from dropbox if they exist - last 30 files are kept"
8080

8181
#check older files exist on dropbox, if yes then delete them
82-
if [ $( echo "$files" | grep -c "backup") -ne 0 ] ; then
82+
if [ $( echo "$files" | grep -c "backup") -ne 0 ] ; then
8383
input=$dropboxlog
8484
while IFS= read -r file
8585
do

0 commit comments

Comments
 (0)