Modify Colors

Default Reverse Brown Dark Blue

Archive

Advertisement

Advanced backup tools that keep multiple copies of files and so on have their place, but sometimes you just need a simple scheduled sync, not a full backup. For example, I have an SD card that stays in my laptop almost all the time. On this, I keep a copy of most of my home folder that gets updated every day at 1:30 in the morning. I no longer have to think about it, it just happens. Here’s how you can do the same thing:

  1. Install GRsync and gnome-schedule. In Ubuntu, you can install GRsync from Add/Remove programs, but gnome-schedule is only available from Synaptic.
  2. Open GRsync and create a new session. Choose the source folder location in the first box and the target folder in the second box. Then you can configure the options below. You will almost certainly want the “delete on destination” option. I have also selected “preserve time,” “preserve permissions,” “verbose,” “show progress,” and “Windows compatibility.”
    screenshot-grsync-home-to-sd
  3. Move on to the advanced options tab. The most important part here is the “additional options” section. Here you can specify anything else you want to pass to rsync, the backend program that actually does the file transfer. The most useful argument you can supply is –exclude=”something”. For example, I have entered this:
    –exclude=’*.iso’ –exclude=’.VirtualBox’ –exclude=’.miro’ –exclude=”.nautilus” –exclude=”.Trash”
    This tells rsync to ignore any file with the extension .iso, skip the VirtualBox, Miro, and Nautilus folders, and skip the trash. If your target directory is a USB hard drive, you may not have to worry about this, but my SD card can’t fit everything, so I don’t copy some of the less important stuff.
  4. Press “Execute” and make sure everything works.
  5. Open Gnome Schedule (in Ubuntu, you can find it under System > Preferences > Scheduled Tasks. Click on new and create a recurring task. Enter whatever you want for a description and choose when you want to backup to run. Finally, enter this as the command:
    grsync -e “name of session
    screenshot-edit-a-scheduled-task
  6. That’s it!

As a bonus, if you want to be able to easily check to make sure your backup ran, create a blank text document somewhere. Then open a new black document and type this in:

#!/bin/sh
grsync -e “session name“;
touch test file location;

Save this as something.sh. Then go back in to Gnome Schedule and change the command to ./filename.sh. Remember that the command is run in the home directory, so if the script is in /home/username/files/scripts/script.sh, you have to say ./files/scripts/script.sh.

Now after every time the backup is run, the test file you created will be updated to say it was last modified at the current time.

Now you lost your excuse. Go back up!

Related posts:

  1. Newbie’s Guide 1.0 Why Linux? 2.0 Getting a Computer 2.1 Live CD’s...
  2. Adobe Air On Linux: What, Why, And How Adobe Air is a technology that allows certain web applications...
  3. Remotely Accessing Your Linux Computer: Part 1 This is the first part in a four part series...
  4. Tricks for Installing and Configuring a Local LAMP Sever LAMP stands for Linux, Apache, MySQL, and PHP, which represents...

4 comments on this post.

  1. rogue says:

    I can set up a scheduled task but they don’t run on schedule – if however I select the task I can click the “run task” button and it runs?

    how do I know if the task is “waiting” in the background and/or find a debug log telling me why the task doesn’t happen?

  2. rm says:

    Very good advice! I upgraded to Ubuntu 9.04 recently, installed MyBook external drive and grsync + scheduled updates work fine.

  3. Psy[H[] says:

    Unfortunately, this will not work right that way in ubuntu, because of this bug: https://bugs.launchpad.net/ubuntu/+source/at/+bug/94933
    You have to place “env DISPLAY=:0″ before each command, on the same line.

  4. InTheLoop says:

    Psy[H[] – Well it works for me on Ubuntu 8.04. The bug appears to be in the ‘at’ package, which looks like it provides an interface to cron. I believe that Gnome Schedule goes directly to cron, so it shouldn’t be affected. I would be interested to know if it doesn’t work for you, though.

    As I described, I have the script set up to touch a file after every run, so I am quite sure it is working for me.

Leave a Comment