I made a shell-script to backup my home-folder and mysql-database using rsync.
Backup destination: a mounted (/mnt/backup) share on a NAS (Lacie Ethernet Minidisk)
1. Due to the permissions on /var/lib/mysql and sub-directories I want to run it as root.
2. I want to execute this script automatically after clicking the shutdown button (so end-of-the-day when I shutdown my machine, as I always do overnight)
Consequently I want to "embed" it in the normal shutdown procedure (whatever this perfect distro does).
Since update-rc.d is not recognized as command I tried to do it manually:
1. placed a testshutdownscript.sh in /etc/init.d
2. made a symbolic link to it in /etc/rc0.d
[hans@localhost rc0.d]$ ls -l S*
lrwxrwxrwx 1 root root 17 2010-07-03 15:11 S00killall -> ../init.d/killall*
lrwxrwxrwx 1 root root 14 2010-07-03 15:11 S01halt -> ../init.d/halt*
lrwxrwxrwx 1 root root 33 2010-09-08 16:29 S30test -> /etc/init.d/testshutdownscript.sh*
But this seems not to work.
Can anybody tell me how to do this?
I do not dare to play around to much with this "internal" stuff, so I did not take the risk to do:
rename S01halt to S02halt, S00lillall to S01killall and my S30test to S00test, but maybe that is the solution?
Hope that someone can help me out!