Run job as soon as drive is mounted?

Asked by Daniel Kraus

Hello,

this is really a great tool, thank you very, very much.

Can I somehow make it create a snapshot as soon as the target drive is mounted? I use an external HD for my backups, and it would be great if I just needed to plug it in to start the backup.

Could it be accomplished with some kind of script that is run automatically after mounting the drive?

I have made the transition to Linux (Ubuntu) only recently, so I don't know all the ins and outs of the OS yet.

Thank you.

Daniel

Question information

Language:
English Edit question
Status:
Answered
For:
Back In Time Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dan (danleweb) said :
#1

To take a snapshot manually you need to run: backintime -b
You can run this from a script but I don't know how to detect whe the drive is plugged in.

Revision history for this message
Steve (newmans-99) said :
#2

I haven't gotten it to work in my environment, for some reason I can mount the drive correctly but this script doesn't get executed when I connect/disconnect. Maybe you can try it and if you can get it to work you can respond back to the group here.

http://www.vitvar.com/blog/?p=12

Good luck,
Steve

Revision history for this message
Steve (newmans-99) said :
#3

Sorry, I should have said that this script can automatically mount a drive when connected to the network. You could probably use this script as a starting point and then modify it so that after it mounts the drive it could then run the backup script.

Revision history for this message
Timo Kluck (tkluck) said :
#4

@the team: Thanks for Back in Time, I really appreciate this tool!

I had the same feature request as mentioned in this thread, so I took the liberty of modifying Back in Time a little. I added a little daemon that waits for drive mounts, then makes a snapshot / asks the user what to do / does nothing (configurable). Download here:

http://www.infty.nl/misc/backintime-common-0.9.26tjk_all.deb (replacement package 1) (need both)
http://www.infty.nl/misc/backintime-gnome-0.9.26tjk_all.deb (replacement package 2) (need both)

Or check the source:
http://www.infty.nl/misc/backintime-0.9.26tjk_src.tar.gz (source)
http://www.infty.nl/misc/backintime-mountmonitor-patch (diff)

Only works in Gnome for now... Also, I hope to find a way to make this work without running a daemon, using udev, dbus or something. That should be a minor change but I haven't figured it out yet.

Looking forward to your comments!

Revision history for this message
Bart de Koning (bratdaking) said :
#5

Thanks! We highly appreciate input, especially modifications that are on our
wishlist. Could you file your code as a separate branch in launchpad? Then
we can have a good look and probably merge that into our trunk!

Cheers,
Bart

2009/11/21 Timo Kluck <email address hidden>

> Question #87362 on Back In Time changed:
> https://answers.launchpad.net/backintime/+question/87362
>
> Timo Kluck proposed the following answer:
> @the team: Thanks for Back in Time, I really appreciate this tool!
>
> I had the same feature request as mentioned in this thread, so I took
> the liberty of modifying Back in Time a little. I added a little daemon
> that waits for drive mounts, then makes a snapshot / asks the user what
> to do / does nothing (configurable). Download here:
>
> http://www.infty.nl/misc/backintime-common-0.9.26tjk_all.deb (replacement
> package 1) (need both)
> http://www.infty.nl/misc/backintime-gnome-0.9.26tjk_all.deb (replacement
> package 2) (need both)
>
> Or check the source:
> http://www.infty.nl/misc/backintime-0.9.26tjk_src.tar.gz (source)
> http://www.infty.nl/misc/backintime-mountmonitor-patch (diff)
>
> Only works in Gnome for now... Also, I hope to find a way to make this
> work without running a daemon, using udev, dbus or something. That
> should be a minor change but I haven't figured it out yet.
>
> Looking forward to your comments!
>
> --
> You received this question notification because you are an answer
> contact for Back In Time.
>

Revision history for this message
Timo Kluck (tkluck) said :
#6

Thanks for replying, I did what you asked. The branch is lp:~tkluck/backintime/mountmonitor

Can you help with this problem?

Provide an answer of your own, or ask Daniel Kraus for more information if necessary.

To post a message you must log in.