In: Computer Science
0 0 * 1 1 rm -r /root/backup/*
0 0 * 1 6 rm -r /root/backup/*
0 0 1/10 * 7 rm -r /root/backup/*
0 0 * 1 1 rm -r /root/backup/*
This crontab will run at 00:00 on every monday in January, which means 5 times, i.e., on 1 January 2018, 8 January 2018, 15 January 2018, 22 January 2018 and 29 January 2018
0 0 * 1 6 rm -r /root/backup/*
This crontab will run at 00:00 on every saturday in January, which means 4 times, i.e., on 6 January 2018, 13 January 2018, 20 January 2018, 27 January 2018
0 0 1/10 * 7 rm -r /root/backup/
This crontab will run at 00:00 on every 10th day-of-month from 1 through 31 and on Sunday, which means:
There are 2 parts, one that runs at 00:00 every 10th day from 1 through 31,i.e.,
January 1,11,21,31
february 1,11,21
March 1,11,21,31
April 1,11,21
May 1,11,21,31
June 1,11,21
July 1,11,21,31
August 1,11,21,31
September 1,11,21
October 1,11,21,31
November 1,11,21
December 1,11,21,31
Another that runs at 00:00 on every Sunday:
January 7, 14 ,21 , 28
February 4, 11, 18, 25
March 4, 11, 8, 25
April 1, 8, 15, 22, 29
May 6, 13, 20, 27
June 3, 10, 17, 24
July 1, 8, 15, 22, 29
August 5, 12, 19, 26
September 2, 9, 16, 23
October 7, 14, 21, 28
November 4, 11, 18, 25
December 2, 9, 16, 23, 30