Linux command ‚date‘ – how to add days to date get new date and use it with ‚Syncthing Versioning‘ option and ‚Syncthing Encryption‘ option

date -d „+1 day“ „+%Y-%m-%d“

————————————————————————

#!/bin/bash
#FileName: BackupModusEncyption.sh
#crontab: 01 01 * * * /root/BackupModusEncryption.sh
set -x

BackupDay=`date -d „-1 day“ „+%Y-%m-%d“`

LocalBackupPath=“/<…>/MOTIONEYE“

cd $LocalBackupPath

tar cvf /home/syncthing/MOTIONEYE/Backup */$BackupDay/*

————————————————————————

#!/bin/bash
#FileName: BackupModusHourEncrsption.sh
#crontab: 31 * * * * /root/BackupModusHourEncryption.sh
set -x

BackupDay=`date „+%Y-%m-%d“`

LocalBackupPath=“/<…>/MOTIONEYE“

cd $LocalBackupPath

tar cvf /home/syncthing/MOTIONEYE/Backup –newer-mtime „60 minutes ago“ */$BackupDay/*

 

#!/bin/bash
#FileName: BackupModusEncryption.sh
#crontab: 11 01 * * * /root/BackupModusEncryption.sh
set -x

BackupDay=`date -d „-1 day“ „+%Y-%m-%d“`

LocalBackupPath=“/var/lib/motioneye“

cd $LocalBackupPath

tar cvf /home/syncthing/MOTIONEYEencryption/Backup */$BackupDay/*

————————————————————————
#!/bin/bash
#FileName: BackupModusHourEncryption.sh
#crontab: 41 * * * * /root/BackupModusHourEncryption.sh
set -x

BackupDay=`date „+%Y-%m-%d“`

LocalBackupPath=“/var/lib/motioneye“

cd $LocalBackupPath

tar cvf /home/syncthing/MOTIONEYEencryption/Backup –newer-mtime „60 minutes ago“ */$BackupDay/*


How to decrypt a Syncthing folder

root@rpi-iot-jsho-syncthing-01:/home/syncthing# syncthing decrypt –password <password> –to /home/syncthing/MOTIONEYEdecryption /home/syncthing/MOTIONEYEencryption

Leave a Reply

You must be logged in to post a comment.