add backup sync script
This commit is contained in:
parent
43d914ed3c
commit
cd7c373277
|
@ -34,3 +34,6 @@ Converts a proxy list in specific txt format to a better readable list
|
|||
|
||||
## imageClean.py
|
||||
python3 script that takes an input image and cleares spare pixels and bot remains
|
||||
|
||||
## backupSync.sh
|
||||
shell script that can be launched with backup.js to sync to a storage server after every backup. It uses rsync which is much faster than ftp, sftp or any other methode
|
||||
|
|
17
utils/backupSync.sh
Normal file
17
utils/backupSync.sh
Normal file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/sh
|
||||
TMPDIR="/tmp/backup"
|
||||
|
||||
#delete older daily backup folders from local filesystem if exist
|
||||
cd ${TMPDIR}
|
||||
if [ "`ls -t | wc -l`" -gt "1" ]
|
||||
then
|
||||
ls -t | tail -n +2 | xargs rm -rf --
|
||||
fi
|
||||
cd - > /dev/null
|
||||
|
||||
rsync -r ${TMPDIR}/ backup@ayylmao:/backup/pixelplanet/canvas
|
||||
|
||||
#clear current daily folder
|
||||
#we do NOT delete the daily folder itself, because the backup script would create
|
||||
#a new full backup if its missing
|
||||
rm -rf ${TMPDIR}/*/*
|
Loading…
Reference in New Issue
Block a user