Find the answer to your Linux question:
Results 1 to 4 of 4
Hello, I've tried to Google and searched this forum for help on this issue, but can't find any. So what is my challenge? I want Ubuntu to copy all content ...
  1. #1
    Just Joined!
    Join Date
    May 2009
    Posts
    2

    Lightbulb Autocopy any usb drive/pen to hd

    Hello,

    I've tried to Google and searched this forum for help on this issue, but can't find any.

    So what is my challenge?

    I want Ubuntu to copy all content from a usb drive or pen into my hard drive automatic. Any one have a good script or program for this?

    Looking forward to your reply.

    Kindly regards
    nine1one4u

  2. #2
    Linux User kmitnick's Avatar
    Join Date
    May 2008
    Location
    Jordan - Amman
    Posts
    329
    assuming the script is /usr/local/bin/script.sh and it is executable.

    first we have to add new rule to udev
    sudo nano /etc/udev/rules.d/10.usbcopy.rules
    then add this
    SUBSYSTEM=="usb",RUN+="/usr/local/bin/script.sh"

    so anytime you plug in/out this will be executed
    if you want just in case of addition add this
    bla bla ,ACTION=="add",bla bla
    NOTE: the previous is not only for stick memory it can be USB CAM or bluetooth so if you want to be specific then
    try attr for full documentation

    See Here
    Dual Booting Ubuntu 10.04, Windows 7

    Toshiba Satellite A200-1M5, Duo Core 2.0 Ghz, 1 Gigs RAM, 256 Intel Card

    You are registered Linux user number 490788
    Happy Linuxing

  3. #3
    Just Joined!
    Join Date
    May 2009
    Posts
    2

    kmitnick

    Thanks for the help, but I tried to get this working and I've read the rules with out any luck. Is there a easy way to check out if the rules are okay?
    My way of testing this was just to put:
    echo "USB is activated"
    in the script to see if it was printing this with no luck.

    I'm a newbie as well in scripting, every thing is solved by programs even when I have been using Linux RedHat and Fedora for over 10 years now as the only OS.

    The past couple of years we have been using Ubuntu at some servers at work and that's where I want to use this functionality.
    So could you please advise me a bit more.

  4. #4
    Linux User kmitnick's Avatar
    Join Date
    May 2008
    Location
    Jordan - Amman
    Posts
    329
    first of all welcome to the Ubuntu family,
    the script I 've given you are being run in the background so you can't see it, and for the first time I was using it I was so frustrated because it didn't work for me, but it was my fault since I didn't know how to shell script, so I use a build it command to test and it was poweroff, and so every time my box boots and finds a usb attached it shuts down so I had to use LiveCD to delete my shell code, any way what I am trying to say here is : make sure of your shell script and may you post here the content of your desired shell script...
    Dual Booting Ubuntu 10.04, Windows 7

    Toshiba Satellite A200-1M5, Duo Core 2.0 Ghz, 1 Gigs RAM, 256 Intel Card

    You are registered Linux user number 490788
    Happy Linuxing

Posting Permissions

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