Results 1 to 10 of 41

Thread: Running backup script with udev

Threaded View

  1. #9
    Join Date
    Mar 2008
    Ubuntu 9.10 Karmic Koala

    Re: Running backup script with udev

    Okay, I just did a test and managed to successfully autobackup a directory on to an NTFS partition on a USB flash drive.

    This is what I did:

    I made a file called
    I used 81 because /etc/udev/rules.d/README says
    Files should be named xx-descriptive-name.rules, the xx should be
    chosen first according to the following sequence points:

    80 rules that run programs (but do not load modules)
    This is the contents of /etc/udev/rules.d/81-local.rules
    SUBSYSTEM=="block", SUBSYSTEMS=="usb", KERNEL=="sd?1", RUN+="/usr/local/bin/"
    and this is the contents of /usr/local/bin/
    mount /dev/sdb1 /mnt
    rsync -a /home/user/test/ /mnt/test/
    One reason why your script was not working is because /dev/sdb1 had not been mounted anywhere at the moment sbackupd was being run. We can use udev, but we need to mount the partition manually first.

    I'm not familiar with how sbackupd works. Are you willing to try rsync? I like rsync.

    Also, let's start by making the script as simple as possible -- comment out the notify-send commands.

    Good luck with the chkdisk. Once you are done with that, it looks like it should be quite easy to setup autobackup using udev.

    Edit: Oh -- I'm very glad you got the drive to work again!
    Last edited by unutbu; March 12th, 2009 at 09:38 PM.

Tags for this Thread


Posting Permissions

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