I have two remote servers, one running Apache and MySQL, and another Apache and Postgresql.
Using these (https://wiki.postgresql.org/wiki/Automated_Backup_on_Linux) scripts as reference, I've created two scripts for each machine that, running at every night, do a dump of the database and a copy of the websites.
The result is that, in every server, I have a
/home/backups/database/mydatabase-[DATE].gz and a
Now, to finish my automated backup setup, I want to, every day, copy the new created files to my local development machine. The problem is that I don't know what to do.
As far as I know, a good approach is:
- Create ssh keys from my local machine and install them in every server
- Use a cronjob to run four scp commands to copy the files created the current day (
scp firstname.lastname@example.org:/home/backups/database/mydatabase-\'date +\%Y-\%m-\%d'.gz, etc)
Is this a good idea, or is there a better approach? Maybe using rsync? Is it secure like ssh? I've never used it...