0

I want to know how I can create a cron job to run a .sh file automatically on every Monday, Wednesday & Friday @ night 12 am USA PST?

1

2 Answers 2

2

It can be done in one line too

0 0 0 0 1,3,5 /pathofscript/

-1

Create THREE cron table entries, one running your script Monday at 0000, one running it Wednesday at 0000, and one running it Friday at 0000. Or schedule script execution for 0000 EVERY day, and have the script exit quietly on Tuesday, Thursday, Saturday and Sunday.

Remember that the "Cron environment" differs from your current environment (different $PATH, $DISPLAY not defined, possible different execution path in ~/.bashrc, ...). Read man 8 cron;man 5 crontab. Initially log start/stop messages to a directory you know exists, like /tmp. If you are not logged in at 0000 M,W,F, your encrypted HOME directory will not be available.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .