Reminder it's Friday the 13th

chao5913
chao5913 used Ask the Experts™
on
I need to write a script with crontab to send a banner note to remind that it is Friday the 13th.
I know it looks like 0 0 13 * 5 ...but what's the follwoing?  And how to put it in script and run it? Anyone can help me?
Thanks a lot!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
> ...but what's the follwoing?
any valid Bourne-shell command.

> And how to put it in script and run it?
write it in a file

In your cron you use your fale like this:

0 0 13 * 5 /bin/sh /path/to/your-file

(there are more ways to do it, that's just one)

Commented:
1. type "crontab -e" - this will allow you to edit your crontab file
2. add the following line:
0 0 13 * 5 /home/you/reminder
assuming that /home/you/reminder is a script that reminds you
3. to verify type "crobntab -l"
Create a file, say /home/friday_the_13th, and type on it:

#!/bin/sh
#This will use /bin/sh to execute this file

#you can echo your message to stdout
echo "It's Friday the 13th, etc, etc."

___________________________________________

That's it. Then on the command line, make your script executable.

> chmod 777 /home/friday_the_13th

Then enter it in crontab:

>crontab -e

If you want to be reminded at exactly 12 midnight, enter this at crontab:

0 0 13 * 5 /home/friday_the_13th

Or if you want to be reminded every hour of the day:

0 * 13 * 5 /home/friday_the_13th
Starting with Angular 5

Learn the essential features and functions of the popular JavaScript framework for building mobile, desktop and web applications.

hey, what's basicaly new in the previous 2 suggestions (except wasting bandwidth)-:
No comment has been added lately, so it's time to clean up this Topic Area.
I will leave a recommendation for this question in the Cleanup topic area as follows:

- Answered by ahoffmann

Please leave any comments here within the next 7 days

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

tfewster
Cleanup Volunteer

Incidentally, depending on which Unix you use, specifying day-of-month AND day-of-week can cause cron to run the command on both, i.e. every 13th of the month AND every Friday (Although this is only supposed to happen if you specify a range).

If may be better to leave the day-of-week out of cron, and have your script test if it is a Friday...
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial