industry-website/htdocs/examples/backup.sh

41 lines
1.0 KiB
Bash
Raw Normal View History

2022-07-11 04:07:03 +00:00
#!/usr/bin/env bash
port_number="46000"
user="caes"
host="omitted"
#uncompressed
cella_dir="/piscina/cella"
cella_exclude="jeni video"
rsync -avz -e "ssh -p $port_number" $(echo --exclude $(echo "${cella_exclude}"|sed 's/\ / --exclude /g')) ${cella_dir} ${user}@${host}:/mnt/data/backup/pergamum/
biblio_dir="/piscina/biblio"
rsync -avz -e "ssh -p $port_number" ${biblio_dir} ${user}@${host}:/mnt/data/backup/pergamum/
chronica_dir="/piscina/chronica"
rsync -avz -e "ssh -p $port_number" ${chronica_dir} ${user}@${host}:/mnt/data/backup/pergamum/
#moved to uncompressed, left for reference
#compressed
#git_dirs="/git/*"
#git_exclude=""
#tar -cJf /piscina/backup_stage/git.tar.xz ${git_dirs}
#cd /usr/local/games/dev/
#tar --exclude="${gamesdev_exclude}" -cJf gamesdev.tar.xz ${gamesdev_dirs}
#mv -v gamesdev.tar.xz /usr/local/backup
# Send all staged files.
#rsync -avz -e "ssh -p $port_number" /piscina/backup_stage/* ${user}@${host}:/mnt/data/backup/pergamum/
# Report time
echo "Backup Script Completed At: `date`" >> ~/sk/backup.sh.output