![]() ![]() For example, set up a folder called private_BKP at the root level of your server, and put a folder in there called Mac_One_BKP. You could use FTP to do this, if you prefer. With shell access set up, create a folder that is outside of the scope of your webserver.If there isn't, contact your ISP directly. If you don't already have it, and you use cPanel to administer your server, then there is often a 'Request Shell Access/Remote Login' option. You're going to need shell access to your server.An Internet Service Provider (ISP) who allows you to connect via SSH.rsync running on your Mac (it's there on 10.4 and 10.5).In this example, we're going to backup the currently logged-in user's Documents folder. Still, if the house burns down, your files will be safe and once you've done the initial backup, rsync is very efficient at keeping your remote backup mirrored with your disk. What it does is create a mirrored backup of your Mac on a remote server, so it's best used in conjunction with a local hard drive-based incremental backup solution. This method does not allow you to roll back to previous dated backups like certain backup solutions do ( Time Machine, for example). And as of Mac OS X Leopard, rsync will even transfer metadata associated with your files like tags and comments. I'm use this technique to backup my two web servers on to each other.If you find online backup solutions expensive and heavy on your system, you might be pleased to hear there is a cheap, easy way to create a mirror backup your Mac (or other UNIX variant) to a secure online server using a program named rsync. I'd love to hear your feedback on this, please comment below. If you would like to use the scripts above you must acknowledge that I'm not responsible for any loss of data. If you don't want to do this step you can simply run the command whenever you want to run a backup.ĭISCLAIMER You should test everything before performing the backups on your live data. That's will schedule the script to run at 11:15am. ![]() Add the following to the file: 15 11 * * * yourusername ~yourusername/backup.sh Next type crontab -e this will open up your scheduled tasks list, in most cases it will open an empty file. Now sure make the file is executable: chmod ug+x backup.sh Rsync -e "ssh" -rca -delete-after ~/test/ :backup First make a new file called backup.sh in your home directory. Now lets create a cron job (scheduled task) to run this script every day. rsync -e "ssh" -rca -delete-after -exclude=Music -delete-excluded ~/test/ :backup Step 4 - Schedule it with cron Optional Sometimes you might want to exclude a directory from being backed up, perhaps your Music directory since that is already backed up on your ipod. :backup - my ssh username is pete, my remote ssh server hostname is, and I am backing up into the directory ~pete/backup.~/test/ - I am backing up / syncing the test directory inside my home directory on my mac.-delete-after - this will delete files on the server if you delete them locally.-e "ssh" - this tells rsync to use ssh if your want to pass in other ssh options such as port you can do that in the quotes: -e "ssh -p 12345".rsync - this syncs the local directory to with the server directory. ![]() Step 3 - Use rsync to backup files incrementally rsync -e "ssh" -rca -delete-after ~/test/ :backup If you own the server you might also want to create a user specifically for this process. I wrote an article called Setting up public key authentication over SSH that will guide you through this step. You can omit this step but you will have to type in your ssh password each you run backup. This step allows the backups to run without prompting you for a password when it runs. Step 2 - Setup automatic authentication Optional Make sure that your SSH user has permission to write to this directory. Step 1 - Create a folder to store your backups on the remote server mkdir backup They are already installed on Mac OS X, and most linux / unix servers. I titled this entry Howto Backup your Mac incrementally over SSH but this technique can also be used to backup any computer that can run rsync and ssh. Do you have access to a shell account on a unix server with some spare space? If so it's pretty easy to incrementally backup your files securely with SSH. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |