systematic backups in Linux?

Tony Baechler tony at baechler.net
Sat May 3 10:11:42 UTC 2008


Karen Lewellen wrote:
> I am trying to remember the command for learning my file size usage up 
> here, but as I now have .pdf files missing too,  it would not be 
> correct in any case.

Hi,

Try this:

du -s

> I may now need to create a server of my own, since I cannot imagine 
> having to send something back up here if I need it...which has 
> happened 4 times in the past few days.
> Plus I want to keep my folder structure in pine if I can.

Well, rsync works both ways, so if files are missing from a remote 
account that are present locally, it will copy them as well as copying 
remote files to the local server.  The idea is to keep a directory 
structure synchronized.  I've used it to back up hard drives and my home 
directory on a server with great success.  I recently posted here about 
backing up email when Daniel asked, but the short answer is that it 
should work just as well for folders and mailboxes as anything else.  I 
have several hundred mbox format mailboxes that copied fine.  Also, 
rsync works over ssh so it should work fine assuming you have a shell 
account and ssh is supported.  That is far more secure than ftp which 
has no encryption at all.

I had another thought.  There are various online backup services that 
might eliminate the need for you to download a huge amount of data and 
wouldn't require DSL or your own server.  Of course you would have to 
pay for such a service, but since it's all done online, you would have 
nothing to worry about storing locally.  There is one service that uses 
rsync but I'm not remembering the name at the moment.  I think the idea 
is that you use rsync to move your files as you would normally but you 
back them up to a restricted ssh account on their server.  I have no 
idea what prices are or how much space you get.

To get you started, here is a sample command line which I use to backup 
my home directory:

rsync tony at example.com:~/ .

Or, to "archive" files including all directories, file permissions, 
dates and times, etc as well as giving more verbose output:

rsync -av tony at example.com:~/ .

You could replace the dot with another drive and path, like this:

rsync -av tony at example.com:~/ g:\serverhome

That doesn't even scratch the surface of what rsync can do but that 
should get you started.  As with all good tools, it has options to 
exclude certain files if you have some stored locally already and don't 
want to back them up.  It scans both local and remote directories first 
so it doesn't download files that are already present, saving time and 
bandwidth.  I wouldn't go back to ftp again for any serious backing up 
because rsync is so much faster and more flexible.

Keep me posted, I'm interested in what options you decide to pursue and 
how it works out.




More information about the Blinux-list mailing list