Announcement

Collapse
No announcement yet.

How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

    How do I automatically copy files from CF-card, USB-storage, etc. upon insertion?

    When I insert my CF-card from my digital cameras into the USB card reader, or when I attach my mobile phone to the USB data cable, or when I insert my LUKS-encrypted USB storage device, or a lot of other use cases; I would like to have the files on the media automatically copied to, say, ~/incoming or something similar.

    How do I accomplish this?

    I use both Ubuntu 10.04 and Kubuntu 10.04 on different devices.

    I hope you have a suggestion.

    #2
    Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

    In principle, this should be possible. A Device Actions entry would be a good place to start. I said in principle, as I don't have enough knowledge of what the Device Action entry needs to contain to advise you on how to create it. Others here might.

    One of the potential problems with doing this, is where the device gets mounted to, which often isn't the same from mount to mount, especially with a USB device. Your CF-card might be an exception.
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

      I agree with SnowHog.

      Maybe write a simple little script, or since what you want isn't anything too complex you could just type the commands (like: cp /media/DRIVE/* ~/incoming or what have you) right into the dialog for creating a new Device Action.

      As far as the potential problems with being mounted in different places, or having multiple cards/devices being mounted to the same place (not at the same time obviously). I have found that if you change the name of your flash card/stick in its file-system this avoids that problem.

      For instance: I renamed a CF card to "SCHOOL_BACKUP", where I store copies of misc files from my school work (as a precaution ) and when I plug it in, it is always mounted to /media/SCHOOL_BACKUP/ and makes my backup script much more friendly

      If you want to go that route (to avoid random/generic mounts) follow this guide:
      https://help.ubuntu.com/community/RenameUSBDrive

      (not sure what Gnome offers for a Device Actions type program.... haven't used it in 10 years.... should be fairly similar though).

      Hope that helps
      Cheers
      Man by his very nature is dependent on other men.

      Comment


        #4
        Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

        Myself, I wouldn't want such an 'automatic' function as this. I want to control what is to be copied, not an automated process. :P
        Using Kubuntu Linux since March 23, 2007
        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

        Comment


          #5
          Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

          Maybe I'm just lazy
          Man by his very nature is dependent on other men.

          Comment


            #6
            Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

            Or just completely trustworthy?
            Using Kubuntu Linux since March 23, 2007
            "It is a capital mistake to theorize before one has data." - Sherlock Holmes

            Comment


              #7
              Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

              I am completely trustworthy.... my script was made by me so I guess it inherits my trustworthiness :P

              The script I use is not automatic. I update and change things manually (since I work on my laptop on occasion and can't be bothered with checking dates/times of files blindly..... think rsync type updating). I manually sync files (ie: over-write/merge files I know I've changed between the two) and then invoke my script to copy the "master" folder back over the backup....... if that makes sense

              Either way, I personally verify that I'm up to date on the important stuff

              Maybe I'm not quite as lazy as I thought


              [edit] I wonder if we've answered the original question though :P
              Man by his very nature is dependent on other men.

              Comment


                #8
                Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

                Originally posted by SIR_Taco
                [edit] I wonder if we've answered the original question though :P
                I don't think so.
                Using Kubuntu Linux since March 23, 2007
                "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                Comment


                  #9
                  Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

                  oh well.... it could be entertaining none-the-less
                  Man by his very nature is dependent on other men.

                  Comment


                    #10
                    Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

                    It _is_ possible. All you have to do is manipulate your hal rules. Check http://wiki.archlinux.org/index.php/...p_2:_Configure if you really want to get into it... You could of course use udev as well - http://wiki.archlinux.org/index.php/...out_udev_rules

                    Still interested?

                    There might be other ways, I'm not sure...
                    Once your problem is solved please mark the topic of the first post as SOLVED so others know and can benefit from your experience! / FAQ

                    Comment


                      #11
                      Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

                      Originally posted by toad
                      There might be other ways, I'm not sure...
                      This is Linux. Of course there are 'other ways.'
                      Using Kubuntu Linux since March 23, 2007
                      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                      Comment


                        #12
                        Re: How do I automatically copy files from CF-card, USB-storage, etc. upon insertion

                        Earlier > Topic: [SOLVED] How can I start Dolphin automatically when USB stick is plugged in?

                        Instead of the launch of the Dolphin do the the copy. Something (not tested) like:
                        Code:
                        konsole --hold -e rsync -P -a /media/usb1 ~/incoming
                        With the konsole so you can see if there are problems


                        More:

                        konsole --help
                        Usage: konsole [Qt-options] [KDE-options] [options] [args]
                        ...
                        --hold, --noclose Do not close the initial session automatically when it ends.
                        -e <cmd> Command to execute
                        ...
                        man rsync
                        NAME
                        rsync — a fast, versatile, remote (and local) file-copying tool

                        SYNOPSIS
                        Local: rsync [OPTION...] SRC... [DEST]
                        ...

                        -P same as --partial --progress
                        ...
                        --partial keep partially transferred files
                        By default, rsync will delete any partially transferred file if the transfer is interrupted...
                        ...
                        --progress This option tells rsync to print information showing the progress of the transfer.

                        ...

                        -a, --archive
                        This is equivalent to -rlptgoD. It is a quick way of saying you want recursion and want to preserve almost everything...

                        > HOWTO find Kubuntu's manual / reference / guide / documentation / help
                        Before you edit, BACKUP !

                        Why there are dead links ?
                        1. Thread: Please explain how to access old kubuntu forum posts
                        2. Thread: Lost Information

                        Comment

                        Working...
                        X