Announcement

Collapse
No announcement yet.

possible to automate save as to two places

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

    possible to automate save as to two places

    Would it be possible to have a script or something that any new user could "do" very simply so that "save as" might save to say "documents" and also to an external usb stick?

    Just a thought, there is also the probably problem of having the same file name in two places which might be an unsurmountable hurdle.

    But it is just a question.

    woodsmoke

    #2
    I assume you mean saving from general apps via the usual dialogues ... as this would be very easy to do as a custom command.

    It might be simpler to have a script synchronising the two folders every minute or so. But that wouldn't help if you want to remove the USB stick straight after saving. And you don't want high-end disk mirroring or RAID setups.

    I actually think this should be quite possible to do. What's needed a location to save to that looks like a directory - because everything is a file in Linux - that is in fact a program that copies its input to two other locations.
    I'd rather be locked out than locked in.

    Comment


      #3
      There's at least 3 or 4 ways I can think of that this can be done. It depends on the specifics of how you want to do it and what your needs are. I think the hardest part would to be sure you were synced before pulling the USB stick.

      1. How about rsync?

      rsync -r -a --delete /home/woody/DoubleSave /media/DoubleSaveUSB

      You'd have to run this to create the mirror each time you saved. You could use inotifywait or iwatch to cause the sync to happen each time you saved or deleted a file. I don't know how this would affect your ability to un-mount the USB stick properly. Look into the inotify-tools package. I might set this up just for giggles.

      2. RAID1 I'm not sure why SecretCode thinks this has to be expensive. It only requires some storage space and a few CLI entries to set up. Difficulty would be re-inserting the USb stick and re-attaching it to the RAID array. I think this could be done automagically.
      3. Cloud, like dropbox or similar.
      4. Cron-job copy, or rdiff-backup that runs as often as you think it needs too.

      Please Read Me

      Comment


        #4
        The reason why I don't think cron jobs are the way to go is that even running every minute (which would cause a lot of excess system activity) would still miss the common use case of "finish work, save document, remove backup USB stick". But a notification change watcher would be ideal - don't know why I didn't think of this.

        The reason why I didn't think RAID was a good option is because I have no practical experience of RAID
        I'd rather be locked out than locked in.

        Comment


          #5
          RAID would be complicated and wouldn't work very well for this use case: you would have to set up a separate partition the same size as the disk and have the raid mounted in a degraded state when the usb isn't plugged in. Not to mention the raid will have to resync the usb every time is is plugged in (which will take longer then just syncing file changes)


          There is another option which I use for backing up my server: Make udev mount and run an rsync script when the stick is detected, that way you can work on your documents then when your done plug in your stick and have it sync them to it. The downside is that this, with most of the other solutions listed requires all documents you want duplicated to be saved in a specific folder.

          Comment


            #6
            hmmmm
            thanks guys, lotsa food for thought here.
            woodsmoke

            Comment


              #7
              I agree with James - the udev rule would be the best way. Once written, forget about it. I think you'd want a dedicated thumb drive for this purpose.

              Please Read Me

              Comment


                #8
                Originally posted by oshunluvr View Post
                I agree with James - the udev rule would be the best way. Once written, forget about it. I think you'd want a dedicated thumb drive for this purpose.
                You can even have multiple thumb drives as udev can detect and fire off the script biased on the label of the drive (so just need to give each drive the same label). This is how my system works.

                Comment

                Working...
                X