Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scheduling task with either 'at' or 'crontab'

Status
Not open for further replies.

MagnumVP

IS-IT--Management
Jul 9, 2002
109
US
I need to run a script exactly one week from a particular day. (Example: I need to popup a message 1 week once I leave on vacation to remind a user to perform a function)

I've tried to use crontab but it only allows me to do it by a time and date and I'm not sure when I need to use it.

Any thoughts?

_______________________________

Also....

I need to run a command that finds the file "core" on 1:30AM every Tuesday and Thursday.

Does this work??? crontab 30 1 * * 2,4 find / -name core
 
The crontab command looks fine, but I think you're possibly confused about it's use. To add your command to the crontab, you need to edit it using crontab -e, then add your 30 1 * * 2,4 find / -name core to it and save the crontab again (just like vi essentially) to make it active.

As for your query about sceduling a message for one week from an as yet unknown date, you'll probably be best employing the at command, but of course that would rely on your remembering to invoke it before you go on holiday! Cheers.
 
I do not try it but something like this should work:

Code:
at 9:00am today +1 week <<EOF
mailx -s Reminder user <<EOF2
Do no forget to permorm action !
EOF2
EOF

or to start one week after a specific day:
Code:
at 9:00am 15/August/2002 +1 week <<EOF

In doubt:
Code:
man at
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top