-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run automatically when pen-drive is plugged in #233
Comments
I have the same use case and fully agree that this would be nice. I guess the solution would be different for each OS. It may be able to use PR #231 to solve this. It can basically detect if Vorta already runs and then trigger some action. In the PR a window is opened, but it could as well trigger a backup. Then the user could use the Distro's way to handle mount hooks to run e.g. |
As long as plugging an usb-device (pen-drive) triggers the backup to the pen-drive, I am happy. It would be nice to have confirmation of backup at the end, such as a notification. |
For Linux you can create udev rule or run script when a specific UUID of a disk is detected. This latter would be even better. |
Then it should be possible to have a checkbox in Vorta and write some templates into those folders if they exist. Any link to this mechanism? Is it widely supported? |
For UDEV rules:
I am not absolutely sure it this is 100% correct (I am writing this from my mind, however, this is one possibility. Another, much better is to detect a disk device with specific UUID. I will describe this later. |
Cool. Thanks for sharing. Since this modifies system folders, Vorta can't automatically change this when it's running as user application. But I could see this added to a kind of "Cookbook" at first, so users can do it as one-time setup manually. Then once there is some experience with it it could be integrated and maybe ask for root-permissions using some mechanism that Gnome or other desktops probably have. |
Yes, in Gnome you can use gksudo, in KDE there is kdesudo, but probably there is some general mechanism for asking for sudo privileges system independently (I am not a programer, but I can ask).
|
Gksu is deprecated. Also, it might be wise if vorta continued to be fully usable without root privileges. |
It seems that iu UDEV rules file you can use |
Just as an example, without root access and with systemd you can place the following file in
where Then you need to enable it with |
That's cool. We should start documenting this somewhere? Like the Github wiki for starters. Later proper docs. |
Well, it doesn't work without modifications to Vorta, right? |
I'd like this too, but it's OS-specific to set up. Vorta could support it by adding a CLI option. E.g. |
Closing this, since we probably can't do any deeper integration for now. |
I am a bit late to the party, but since it took me a while to get all the details right on my Linux computer (Linux Mint 22), I decided to post my working solution, here. Preparation:
Set up automatic Vorta backup, when a specific .mount unit becomes available: Identify the .mount unit for your usb-device. For example for an Intatek USB-device, the following unit might be available: Place the following systemd .service-file in ~/.config/systemd/user/auto-usb-vorta-backup.service.
Start the service: Now, when you plugin/ mount your USB-device, the profile "USB_disk_backup" will be started. Useful commands, for maintenance: After changing the .service file, one has to reload: Detailed systemd logs: |
If you do not want Vorta to run in the background permanently, you could adapt the ExecStart line as follows: This command first checks if Vorta is already running.
|
Is your feature request related to a problem? Please describe.
I would like vorta to support running a backup whenever a pen-drive is plugged in.
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: