...
Add the private keys to remotebackup required to log into other systems to transfer backups.
Creating the Backup Destination
The backup destination will only have r/w access by remotebackup
...
Scripting
Note that the ash is the default shell. Synergy selected ash because it is a lightweight version of bash and generally compatible.
Creating the rsync script
Code Block | ||
---|---|---|
| ||
#!/bin/bash
rsync -av --delete -e ssh remotebackup@ip:/source/ /destination/ |
To test run scripts the command is
Code Block | ||
---|---|---|
| ||
sh script.sh |
Adding the Cronjob
To add the script to cron edit the crontab located in /etc/crontab make sure you are root.
If you are unsure of how to schedule time view the cron page
Code Block | ||
---|---|---|
| ||
vi /etc/crontab
0 5 * * * remotebackup /path/to/script.sh #The script must be run by the remotebackup user because of permissions. |
When adding or removing commands to the crontab make sure to restart the crond service so the commands take effect.
Code Block | ||
---|---|---|
| ||
synoservice --restart crond |
To view the logs to see if your cronjob was run is located in /var/log/messages
Connecting with Clients
Mac OS X Auto Mount
...
How to clear history of last command - http://thoughtsbyclayg.blogspot.ca/2008/02/how-to-delete-last-command-from-bash.html
Using Crontab
When adding or removing commands to the crontab make sure to restart the crond service so the commands take effect.
Code Block | ||
---|---|---|
| ||
synoservice --restart crond |
To view the logs to see if your cronjob was run is located in /var/log/messages
Improving the Automatic Backup
...