Bash script to copy files from one server to another (same network)
- Posted:
- Closed for Proposals
- Remote
- #104401
Description
I need a bash script writing that will do the following:
Email Server (192.168.0.9) - Ubuntu
File Server (192.168.0.20) - Freenas/FreeBSD
Backup files are store on the email server at location: /opt/email/backup/sessions
Storage folder is: /mnt/Data/BACKUPS/email
There are approx 100GB of files split over multiple folders as shown below. The incr folders are small, the majority of the full folders are small, with one that is 100GB.
[sample folders]
full-20111116.190100.082
full-20111118.190039.864
full-20111120.180004.979
incr-20111115.190013.081
incr-20111116.190008.131
incr-20111117.190007.984
incr-20111118.190010.132
incr-20111119.190010.663
incr-20111121.190008.858
I need the script (i will set a cronjob up for this) to rsync all of these NEW files/folders over to the storage server.
It will need to check if any of these files are older than a certain period(i want to be able to edit the script and change the number of days if I want) and delete the ones that are.
Email Server (192.168.0.9) - Ubuntu
File Server (192.168.0.20) - Freenas/FreeBSD
Backup files are store on the email server at location: /opt/email/backup/sessions
Storage folder is: /mnt/Data/BACKUPS/email
There are approx 100GB of files split over multiple folders as shown below. The incr folders are small, the majority of the full folders are small, with one that is 100GB.
[sample folders]
full-20111116.190100.082
full-20111118.190039.864
full-20111120.180004.979
incr-20111115.190013.081
incr-20111116.190008.131
incr-20111117.190007.984
incr-20111118.190010.132
incr-20111119.190010.663
incr-20111121.190008.858
I need the script (i will set a cronjob up for this) to rsync all of these NEW files/folders over to the storage server.
It will need to check if any of these files are older than a certain period(i want to be able to edit the script and change the number of days if I want) and delete the ones that are.
Clarification Board
There are no public clarification questions.
Gravesend 