LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-10-2017, 08:54 AM   #1
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, CentOS, FreeBSD
Posts: 3,362

Rep: Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907
Crontab and days of the week


Hi,

Quick question about crontab. I'm on a Slackware 14.1 server, and I have to configure a firewall policy according to working hours (blocking Facebook and various nuisances through Iptables).

Is day 0 actually sunday or monday?

Cheers,

Niki
 
Old 11-10-2017, 09:00 AM   #2
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, CentOS, FreeBSD
Posts: 3,362

Original Poster
Rep: Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907Reputation: 1907
I'll answer this myself, after wading through a few tutorials. I was puzzled by the fact that crontab has 8 weekdays. As far as I understand, it goes like this.

1 - 5 = Monday - Friday

6 = Saturday

0 or 7 = Sunday

Correct me if I'm wrong.

Cheers,

Niki
 
Old 11-10-2017, 09:03 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,430

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
You are correct.
 
1 members found this post helpful.
Old 11-10-2017, 09:40 AM   #4
Turbocapitalist
Senior Member
 
Registered: Apr 2005
Distribution: Ubuntu, Devuan, OpenBSD
Posts: 2,707
Blog Entries: 3

Rep: Reputation: 1183Reputation: 1183Reputation: 1183Reputation: 1183Reputation: 1183Reputation: 1183Reputation: 1183Reputation: 1183Reputation: 1183
See also "man 5 crontab" for the official explanation of the file format.
 
Old 11-10-2017, 10:39 AM   #5
orbea
Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 807

Rep: Reputation: Disabled
Open 'crontab -e' and add this comment at the top.

Code:
# minute (0-59) hour (0-23) day (1-31) month (1-12) day of week (0-6)
 
Old 11-10-2017, 06:51 PM   #6
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 3,705

Rep: Reputation: 999Reputation: 999Reputation: 999Reputation: 999Reputation: 999Reputation: 999Reputation: 999Reputation: 999
I simply use this site to help: http://corntab.com/
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
On what days of the week do you work ? metaschima General 8 07-22-2014 03:53 PM
Crontab entry to schedule a script every 14 days senrooy Linux - General 12 06-03-2009 09:54 AM
Correct syntax for days in crontab kaplan71 Linux - General 1 03-12-2009 01:46 PM
crontab every 2 days winlinfix Linux - Newbie 4 10-09-2007 10:49 AM
Crontab every 15 days, isn't possible? deqmacrom Linux - General 3 04-07-2005 03:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:20 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration