frm
Well-known member
I run these two commands to do an SSH backup, one on the DB server and the other on the files server:
What I would like is an SSH (BASH) script from this to first connect to the DB server and then check if there's a newer backup and then download it and check if they're the same files at the end (file size/hash) and then disconnect and then repeat for the file server so I can put these BASH scripts on different servers for quicker dumps with redundant backups. If possible, to even first run the backup commands from the remote server and then download the respective files when done too.
A password = variable for the servers and MySQL database password to get the backup at the top of the .sh script would be preferred so that it can be edited each time for security purposes.
Is this doable with scripting or would I still be stuck just downloading and uploading manually?
mysqldump -u xf_u -p xf_p > site-$(date +%F).sql
tar -zcvf site-xfver-date.tar.gz public
What I would like is an SSH (BASH) script from this to first connect to the DB server and then check if there's a newer backup and then download it and check if they're the same files at the end (file size/hash) and then disconnect and then repeat for the file server so I can put these BASH scripts on different servers for quicker dumps with redundant backups. If possible, to even first run the backup commands from the remote server and then download the respective files when done too.
A password = variable for the servers and MySQL database password to get the backup at the top of the .sh script would be preferred so that it can be edited each time for security purposes.
Is this doable with scripting or would I still be stuck just downloading and uploading manually?