Backing up your Linux home directory in a flash

This is a quick and dirty method of backing up each and every directory that you have in your home folder. Most of you would probably know this anyway, but I thought I might just repost it here.

tar cvpf backup.tar `ls`

Perhaps a better way is to create an incremental backup each time.

tar cvpf backup.tar -g snapshot `ls`

This command compares the timestamps of files in the current directory with that of snapshot, and the resulting differences are written into backup.tar. This method ensures that you only write incremental changes and not the whole directory over and over again.

If there is any particular file/folder you do not want to backup, you can specify the –hide option in ls as follows:

tar cvpf backup.tar -g snapshot `ls --hide=Desktop`

That will ensure that the Desktop folder is not backed up.

Related Posts Plugin for WordPress, Blogger...

9 Responses to Backing up your Linux home directory in a flash

  1. Arsento says:

    I added your blog to bookmarks. And i’ll read your articles more often!

  2. Jens says:

    Thank you, i will save this :)

  3. [...] This post was mentioned on Twitter by linuxcanuck, Larry King. Larry King said: Backing up your Linux home directory in a flash | AllForLinux.com: This is a quick and dirty metho.. http://bit.ly/82RfDd #Linux #News [...]

  4. This is wrong the filesystem is not meant to be mounted on the ~/Desktop/ directory the only thing contained in there should normally be *.desktop files which refer to the filemanager to open the directory at which the mounted device is actually mounted.

    If you really are that insane and want to mount a a device in your ~/Desktop/ directory execute the following:

    mkdir ~/Desktop/MountedFS
    sudo mount /dev/sd** /home//Desktop/MountedFS
    where /dev/sd** stands for the (USB or SCSI) Device you want to mount. In case you have a IDE harddrive you want to mount the command would be /dev/hd** .

    The FHS(http://proton.pathname.com/fhs/) is very clear and strict about where you actually can/should mount devices!

  5. infernus_crusher says:

    Hi Andreas Marschke,

    Thanks for the feedback. I’ll edit the post to reflect the changes. But no, I did not mean that one should try mounting their file systems on the Desktop.

  6. rogerrulez says:

    That’s a great way !! I’m running the backup now and I’m new to linux so how do I do a restore ??

  7. rogerrulez says:

    Btw, I just found this site and it’s great !!

  8. rogerrulez says:

    Am I allowed to post questions or comments here ??

Leave a Reply