running script at shutdown(SOLVED)

I would like to save back copies of the Korganizer calendar file - std.ics for a running week . I've written a script to do this:
It works fine in the terminal. I copied it to /etc/init.d; owner is root and it is executable. I then symlinked it to rc0.d and rc6.d using K75 as the prefix (K75calendar_backup.sh). Apparently something more is needed.
Any suggestions would be appreciated.
- Code: Select all
#!/bin/bash
#
NOW=$(date +%a);
cp /home/(user)/.kde4/share/apps/korganizer/std.ics /home/(user)/CalendarBackup/std_$NOW.ics
exit 0
It works fine in the terminal. I copied it to /etc/init.d; owner is root and it is executable. I then symlinked it to rc0.d and rc6.d using K75 as the prefix (K75calendar_backup.sh). Apparently something more is needed.
Any suggestions would be appreciated.