Advice on setting a cron task using crontab manager

Hello Team,

I’ve installed @stephdl crontab manager to setup scripts to clean up my shared folder recycle bins on a regular basis.

I’d like to have my scripts run on Friday night at 11:30 PM. So I’m attempting to setup a weekly job schedule.

Here is a picture of what I think I need to do. My questions are:

Have I set this up correctly?
What do I put in the Day and Month dropdown? I want this scrip to run weekly on Friday night.

Thank you.

@greavette

Hi Charles

As per Screenshot, that job would run every Saturday at 23:30 (11:30 PM).
Change the day to Friday, and you got Bingo!
Or, if you prefer, say 02 for hour and 30 For Minutes, then the job will run very early Saturday morning…)

My 2 cents
Andy

PS: Don’t forget to make the script executable… :slight_smile:

2 Likes

Thanks @Andy_Wismer for this reply. I thought that leaving the Day and Month at * would mean they would override the week. Good catch on the day…I had said Friday but meant Saturday night.

Thanks again!

@greavette

Hi Charles

Here’s the background:

In crontab, the format is as follows, using the 02:30 AM example:

30 2 * * sat

(You can also use 0-6 or 1-7 for the days instead of sat.)

Every 5 minutes would be:
/5 * * * *

The * could be interpreted in plain english as “doesn’t matter, just ignore this field”, as such, an * does always “fit”!

The crontab module just tries to replicate the real cron usage as close as possible…

My 2 cents
Andy

1 Like

Great explanation @Andy_Wismer! Thanks!

Sometimes, going the extra step not only helps getting a solution, but increases awareness of what’s happening in the background. This again can help in similiar solutions - before a question arises - and may also help others…

After all, crontab is predominant in the UN*X / Linux field, and it’s format is used in several other software packages besides crontab itself!

A lot of Web packages use the crontab format, without actually using cron itself (Implemented directly in PHP, Perl, JAVA or what have you…).

My 2 cents
Andy

1 Like