LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Running cron job on every Monday, Wednesday & Friday of a week (https://www.linuxquestions.org/questions/linux-newbie-8/running-cron-job-on-every-monday-wednesday-and-friday-of-a-week-4175572142/)

RithanyaLaxmi 02-13-2016 12:49 AM

Running cron job on every Monday, Wednesday & Friday of a week
 
Hi,

I want to know how I can run a cron job every Monday, Wednesday & Friday in a week?Also how I can create a cron job whether it should be created as .sh file which in turn will have the cron expressions to invoke another .sh file which eventually trigger the load? How this cron job will be invoked automatically whether I need to copy this cron job which will be in .sh format in a particular directory from where it will be automatically invoked? I am new to linux hence please help me out in this?


Thanks

Michael Uplawski 02-13-2016 01:14 AM

Quote:

Originally Posted by RithanyaLaxmi (Post 5499452)
I want to know how I can run a cron job every Monday, Wednesday & Friday in a week?

That is the easy part of “running a cron job”. Which kind of trouble are you facing, when you apply the instructions that you get from he man pages (man crontab and more about the composition of cronjobs in man 5 crontab). Have you already configured other cron jobs on your system? In that case, how is this one different or more complicated?
Here is a version of the manpage from section 5 in an online version: crontab(5). English is not my mother language and the authors of these help files have done a great job explaining just anything. PSE try first to get the information from there. Come back if it isn't clear.

EDIT: I forgot to tell you that the easiest way to access to your personal crontab file should be the command
Code:

:$~crontab -e
Quote:

Also how I can create a cron job whether it should be created as .sh file which in turn will have the cron expressions to invoke another .sh file which eventually trigger the load? How this cron job will be invoked automatically whether I need to copy this cron job which will be in .sh format in a particular directory from where it will be automatically invoked? I am new to linux hence please help me out in this?
I have problems to understand this part of your description, but venture that, basically, you want to call one shell-script from another. PSE confirm before we go ahead.

RithanyaLaxmi 02-13-2016 02:50 AM

Just I want to know how I can create a cron job that will automatically run on every Monday, Wednesday & Friday @ night 12 am USA PST? Any samples on this is really appreciated.

Michael Uplawski 02-13-2016 03:01 AM

Quote:

Originally Posted by RithanyaLaxmi (Post 5499477)
Just I want to know how I can create a cron job that will automatically run on every Monday, Wednesday & Friday @ night 12 am USA PST? Any samples on this is really appreciated.

Examples. Do this :
Code:

:~$ man 5 crontab
Scroll towards the bottom until it says “Examples”: Voilà: Examples.

Then, come back and tell us, why they aren't “good examples”.


All times are GMT -5. The time now is 11:59 AM.