Backup depending on bootups or connections to wifi network
Hi Terry,
this is more a suggestion than a question:
The scheduler in deja-dup offers some options to chose from: every day, every week and so on.
I would suggest to offer an additional type:
Backup every bootup, every second boot-up.
Or: Backup at every third connection to your local wifi-network.
Background 1:
Many avarage users do not use their notebook everyday.
There might be two weeks of heavy usage - than a daily backup would be senseful.
But there might be a week of lazyness - where there is just nothing to backup.
Background 2:
In these days it becoms quite popular to have a local NAS at home, where your can play media files from and -- where you can backup to.
Backing up is only possible, when you have access to your local NAS, mostly through your wifi-router.
deja-dup could count the connections to the local wifi-network and start the backup after a specific numberof connections.
I wrote a small script to illustrate this:
#!/bin/bash
USERNAME="<put your username here>"
ESSID_ATHOME="<put the id of your wifi network here>"
MAX_CONNECTIONS=5
COUNTER=
if [ -e $COUNTER ]; then x=$(<$COUNTER); else x=0; fi
case "$2" in
up)
if (nm-tool | grep -q $ESSID_ATHOME); then
echo $((x+1))>$COUNTER
if [ $x -gt $MAX_CONNECTIONS ]; then
sudo -H -u $USERNAME "deja-dup --backup"
$(grep -z ^DISPLAY= "/proc/$(pgrep gnome-session)
echo $((x=0))>$COUNTER
fi
fi
;;
*)
esac
exit $?
This script should go into /etc/NetworkMan
The critical part is the line
sudo -H -u $USERNAME "deja-dup --backup"
deja-dup seems to start in root context anyway. (Any suggestions for that?)
Thank your for listening!
wwjd
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Déjà Dup Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Michael Terry
- Solved:
- Last query:
- Last reply: