I am using rsnapshot to backup my machines to a remote nfs nas device. This is somewhat tricky to use with my laptop since it is not guaranteed to be online at a specific time and for a necessary time span. Also, the user needs to be logged in due to ecryptfs <> nfs difficulties. Because of that, I trigger the backup on user login using upstart. I also do a simple time check because it is possible for the user to boot more than once a day and running backups every time would be inefficient. If the user decides to reboot/poweroff/logout before the backup is complete, a problem arises. A resume function is not supported in rsnapshot as far as I know and having an incomplete backup is very undesirable.
Is there a way to "warn" the user if he wishes to reboot/poweroff/logout from gnome (unity/lightdm?) session before the backup being completed? I am thinking of something similar to the dialog saying "Program xy is still active [...]".
It would be nice if this could be done via some programmatic condition, eg
if [ -e /run/backup_is_running]; then show_warning(); fi