I have a server 1 (running Ubuntu), on this server, a website. I have a server 2 (running Win Server 2012), on that server some application are running and I have space for my backups.
Server 1 has limited space, so I keep backups of both my MySQL database and Webserver file for 1 week only (daily backups).
When doing my daily backup, the script does the following : - backup MySQL to a file (Mysqldump) - Compress the Webserver root folder to a tar.gz - push both generated file to a FTP server (total is 6GB) - clean for files older than retention period
Now I want to add a step to have a stronger backup policy on server2 (keep daily for 10 days, have a weekly for 5 weeks, a monthly for a year and keep the yearly forever). Each backup interval is in a folder (i.e. a Daily folder, a weekly folder, a monthly folder and a Yearly folder)
I want that every sunday my backup file is copied both in Daily and Weekly folder (each of them being cleaned per policy explained previously and with another schedule task), I do not want to FTP it twice. I want basically from server1 to copy the file from \Server2\Daily to \Server2\Weekly.
Is RCP the right thing to use? I could not find how to use it with password.
well, some more research suggested me to go to a web service, so I ended up with the following setup.
in my cron job on Server1, after pushing the backed up files to the FTP server, I call (using curl) a php script on Server2, this PHP script will then call a batch file to do the copy/duplication job all on Server2.