Re: Using Command Line For Backups



Jaimie Vandenbergh <jaimie@xxxxxxxxxxxxxxxxxxxxx> wrote:
On Tue, 28 Jun 2011 11:42:46 +0100, Chris Ridd <chrisridd@xxxxxxx>
wrote:

On 2011-06-28 11:25:47 +0100, Jeff Gaines said:

I want to back up my home directory to my NAS, I'm running:

cp -r /Users/jeff/* /Volumes/share/MacMini

in a terminal window and it seems to be working, although I think it's
copying the various links like Applications as well which isn't
necessary.

Is there a command that will just copy updated files? I've looked at
man cp and couldn't see it there. Perhaps there's an alternative
command that would be better?

The "best" one is rsync, though it is a bit unfriendly. There's a
Mac-friendly wrapper for it.

No more unfriendly than cp, I'd say!

rsync -vaE /Users/jeff /Volumes/share/MacMini/

would be sufficient. Or if the NAS supports rsync, then

rsync -vaE /Users/jeff NAS::rsyncshare/MacMini/

Alternatively, can you use TimeMachine with your NAS? It makes life
*much* simpler.

And is loads better since it (a) gives you versioned updates, (b) a
visual way of retrieving old files as well as commandline, (c) you can
use it to restore your user and settings from after a reinstall in an
Apple supported way.

I use rsync to update my TM backup to a third location.

I use rsync to sync my laptop iTunes to a firefly server. It's excellent
for when you need to clone one directory hierarchy into another. Not really
backup, more like what we refer to as "business copy" in my working life.

More efficient than cp for use as a general purpose copying tool.
.



Relevant Pages

  • Re: sending selected files to remote machine (NOT an incremental backup!)
    ... I DON'T mean an incremental backup! ... A single command can combine multiple commands into a single executable ... > Why not use rsync? ...
    (comp.os.linux.misc)
  • Re: Quick backup
    ... present backup script already does). ... to do daily snapshots and rsync to only copy changed files. ... rm command to get more snapshots ...
    (Ubuntu)
  • Re: Backup Image for my needs
    ... I will store on windows box connected ... My backup consists of just copying the 'files' to a backup medium ... Here are two links on how to create backups with rsync. ... type 'man command' on the command line. ...
    (Debian-User)
  • rsync backup size
    ... I run rsync with the command: ... to back up to a usb hard drive that already had a full backup on it. ... This appears to happen with no special command option. ... If it's the target, it means there was no compression. ...
    (Ubuntu)
  • [SLE] Can anyone recommed a backup program/script for home user
    ... Would like to thank Bruce for a detailed instruction to do backup. ... Now I will write a little script containing this command and when req just ... > also have success with rsync. ... -e ssh to use ssh to do the connection. ...
    (SuSE)