Added VPS backup script.

master
parent 7ea9e94e8e
commit 2808014096

@ -5,6 +5,9 @@
**backupProgramFiles.sh** **backupProgramFiles.sh**
This is a script that I created to zip up my Program Files folders on my C: drive as those are permanently excluded by the backup software I use. I could probably dive in and pick specific applications that I know store their configutaions in the Program Files folders but for now I just do the whole thing. This script also clears out backups older than 2 weeks (I run it weekly) and emails a summary to the provided address through the specified mail relay server. Be sure to edit smtp-creds.sh to include your information. This is a script that I created to zip up my Program Files folders on my C: drive as those are permanently excluded by the backup software I use. I could probably dive in and pick specific applications that I know store their configutaions in the Program Files folders but for now I just do the whole thing. This script also clears out backups older than 2 weeks (I run it weekly) and emails a summary to the provided address through the specified mail relay server. Be sure to edit smtp-creds.sh to include your information.
**backupVPS.sh**
This script was written to automatically sync the backups I create on my server with my local machine as a part of the 32-1 backup rule.
**convertHEICtoJPG.sh** **convertHEICtoJPG.sh**
This script will convert your HEIC files (a format Apple saves photos with) to JPGs. Flip saveasjpg at the top to save as PNG instead. This will result in much larger file sizes. Set keeporiginals to 0 to delete the HEIC files after they're converted. The HEIC files are saved kept around by default. For best results set this up as a cron job. This script will convert your HEIC files (a format Apple saves photos with) to JPGs. Flip saveasjpg at the top to save as PNG instead. This will result in much larger file sizes. Set keeporiginals to 0 to delete the HEIC files after they're converted. The HEIC files are saved kept around by default. For best results set this up as a cron job.
\* Requires the ImageMagick CLI software to be installed with HEIC support. There are links at the top of the script to do this. \* Requires the ImageMagick CLI software to be installed with HEIC support. There are links at the top of the script to do this.

@ -0,0 +1,20 @@
#!/bin/bash
# https://www.digitalocean.com/community/tutorials/how-to-use-rsync-to-sync-local-and-remote-directories
# https://linuxhandbook.com/bash-arrays/
# https://stackoverflow.com/a/169517
remotedirs=('bookstack' 'gitea')
# Server must have an ssh entry set up in ~/.ssh/config with the
# host, user, port (if non-standard), and identityFile.
server="vps-b"
remotehome="~"
localhome="/mnt/b/Backups"
let mydirs="${#remotedirs[@]}-1"
for i in $(seq 0 $mydirs); do
echo "Downloading $server:$remotehome/${remotedirs[$i]}/ to $localhome/${remotedirs[$i]}/..."
rsync -a $server:$remotehome/${remotedirs[$i]}/ $localhome/${remotedirs[$i]}/
done
Loading…
Cancel
Save