I have wakeup script that runs when the system wakes up (Arch linux)
$ cat /usr/lib/pm-utils/sleep.d/example
#!/bin/bash
case "$1" in
resume)
echo "hey I just got resumed!"
/usr/bin/bash /home/user/bin/wakeup_script
esac
my wakeup_script
$ cat bin/wakeup_script
#!/bin/bash
/usr/bin/touch /home/user/testwake.txt
/usr/bin/rsync -vaz [email protected]:/home/user/downloads/test.txt /mnt/data/
/home/user/bin/mnt d
you can see that the script "wakeup_script" contains three bash script. When the system wakes up, the first and third script runs very well but rsync never worked, I tried scp, it doesn't work again! what's wrong here?
when I execute the same "wakeup_script" in a shell, the rsync does work but it doesn't get executed when the system wakes up!!
$ /usr/bin/bash /home/user/bin/wakeup_script
rsync
command rely on an SSH identity from your user's~/.ssh
? when run by root (from pm-utils) it will be looking in/root/.ssh
instead/usr/bin/bash /home/user/bin/wakeup_script &> /tmp/wakeup.log