mzsade wrote:...Is this right, for 00:00 hrs. every 15th of December for every day of the week?
- Code: Select all
0 0 15 12 * root /usr/bin/date | date --set | hwclock --set --date
It looks correct but I'd /path/to/date and /path/to/hwclock
Also, you CAN use pipes this way but it may have unpredictable results, so I'd recommend
- Code: Select all
#!/bin/bash
/usr/bin/date | /usr/bin/date --set | /usr/bin/hwclock --set --date
Your path to hwclock may not actually be /usr/bin/hwclock, so check.

and call it in cron with
- Code: Select all
0 0 15 12 * root /path/to/your/script.sh
mzsade wrote:Will the cron job be aborted for a particular day if the computer happens to be powered off at the scheduled time?
Yes.
If it gives you any grief, run the /path/to/your/script.sh from terminal and see if it does the job correctly/as expected, if not
modify the script slightly with
- Code: Select all
#!/bin/bash
set -x
/usr/bin/date | /usr/bin/date --set | /usr/bin/hwclock --set --date
and run that in terminal and it will show you "more" (errors etc)..
HTH.