how to schedule a cron job to run every second week - cron

I have a cron command which I using currenly for run daily. I want to make it run every second week Monday morning 9AM. please advice
0 0 * * * curl -s -L web.url.com/user/adminNotifier

you can use this site to generate Cron command
http://crontab-generator.org/
hope this helps you

Related

How install CronJobs for viefaucet script

I am trying to add at tabels from picture 1 CronJobs for reload every mounth at 1st day. How can i do ? Need only the link(path) not code .
You could've known the right way to do it when you would've read the Documentation you got with the Script.
Cronjob is used to update currency price, contest and lottery status, ... automatically.
From Cpanel, click on Cron Jobs, add the following cronjobs:
Cpanel
curl FAUCETURL/cronjob/fiveminutes
Every 5 minutes
curl FAUCETURL/cronjob/daily
Every day at 0:00
Hostinger, AAPanel, ...
wget -O /dev/null FAUCETURL/cronjob/fiveminutes
Every 5 minutes
wget -O /dev/null FAUCETURL/cronjob/daily
Every day at 0:00
The Link for these two Cron Jobs would be:
FAUCETURL/cronjob/fiveminutes
FAUCETURL/cronjob/daily

I want the cron job to run the script weekly basis

I am trying to setup a cron job on a Ubuntu server. I want the cron job to run the script on weekly basis. Problem is - It should be a working day, If im mentioning it with time interval, it fails during weekoffs - Need an Schedular Exp which has to work weekly only on working days at office hours.(9am to 9pm)max.
Want to Execute the script every week #6 pm during the weekdays. It Can be Mon to Fri.
Step1
sudo apt-get install cron
systemctl status cron
Step2
Configure the cron job:
crontab -e
Select an editor of your choice
0 0 * * 0 /path/to/command
Syntax: minute hour day-of-month month day-of-week command.
Day-of-week goes from 0-6 where 0 is Sunday.
Save it.

How to configure cron to run at multiple random intervals?

I'm working on a new project and I would like to setup a cron to run every 6-8 hours at a random minute. Any suggestions on the best way to achieve this would be greatly appreciated.
Let's run the cron every 6 hours:
0 */6 * * * /path/to/script.sh
Now, in your bash script:
#!/bin/bash
maxdelay=$((2*60)) # 2 hours converted to minutes
delay=$(($RANDOM%maxdelay)) # a random delay
(sleep $((delay*60)); /path/to/script.sh) & # background a subshell to wait, then run the script
You can also use anacron for RANDOM_DELAY feature.

Is this the correct way to run a script at certain hours?

I'd like a cron job to run a command at:
8am
10am
5pm
7pm
9pm
11pm
I've tried this, but when I check my logs, I see that the command is run too many times.
* 8,10,17,19,21,23 * * * COMMAND >> mylog.txt
Your command means "run on every minute of the given hours". If you want to run it just once, you need to set the minute field, e.g.:
0 8,10,17,19,21,23 * * * COMMAND >> mylog.txt
This way the command only runs at the start (minute 0) of each of the given hours

Cron job to run a script at the begining of the month

I would like to write a cron job that has to run a PHP script on the 1st day of each month.
Can you please help me with this?
Thanks.
Add to crontab -e this:
0 0 1 * * php /path/to/script.php
Good luck!

Resources