Results 1 to 4 of 4

Thread: Back Up Documents Folder to Flash Drive

  1. #1
    Join Date
    Apr 2007
    Beans
    67
    Distro
    Ubuntu 8.04 Hardy Heron

    Back Up Documents Folder to Flash Drive

    Hello,

    I'm interested in backing up my Documents folder to a USB flash drive. I don't care about any of the settings or system files, but I'd like to backup my Documents daily. Are there any simple tools or scripts that might do this? Since I'm using a laptop, I'm mot sure if an automatic schedule would work as I'm not sure when the computer is on or when the drive is plugged in. Are there any quick ways of doing this on a daily basis?

    Thanks,
    igfud
    .... .- -- .-. .- -.. .. --- .-. ..- .-.. . ...

  2. #2
    Join Date
    Jan 2008
    Beans
    4,757

    Re: Back Up Documents Folder to Flash Drive

    You can add a script in your logout file.
    So that it saves the file to a tarball and stores it somewhere in the filesystem/on the pen drive.

    Code:
     gksu gedit /etc/gdm/PostSession/Default
    Will get you there.

    And before the line that says "exit 0"
    Have something like this:
    Code:
    if [ -d "$HOME/Documents" ]
    then
        export name=$(whoami)
        export time=$(date | awk '{print $2$3"_"$6}')
        tar cvf $name-Documents-$time.tar.gz $HOME/Documents
        mv $name-Documents-$time.tar.gz /media/FLASHDRIVE/BACKUP/
    fi
    That will save tarballs of your Documents folder.
    The naming convention is simple enough:
    username-Documents-date_year
    ie:
    iain-Documents-Apr24_2008.tar.gz
    Is that verbose enough for you?

    Regards
    Iain
    Last edited by ibuclaw; April 24th, 2008 at 01:00 AM.

  3. #3
    Join Date
    Nov 2007
    Location
    Santa Cruz, CA
    Beans
    346
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Back Up Documents Folder to Flash Drive

    I like to use rsync (it is a command line program, but you can use Grsync as a graphical frontend). It will do progressive backups, so it will only backup things that have changed since your last backup. I use it to backup my laptop's /home to an eternal hard drive.

    It has an insane amount of options that should suit almost anyone's needs.
    Registered Ubuntu User #20847

  4. #4
    Join Date
    Apr 2007
    Beans
    67
    Distro
    Ubuntu 8.04 Hardy Heron

    Re: Back Up Documents Folder to Flash Drive

    Is that verbose enough for you?
    Perfect!! That is exactly what I was looking for. Thanks!

    I'll also look into rsync--sounds like it would be another good method of maintaining backups.

    igfud
    .... .- -- .-. .- -.. .. --- .-. ..- .-.. . ...

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •