LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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, 07:54 AM   #1
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, CentOS, FreeBSD
Posts: 3,362

Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
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, 08:00 AM   #2
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: Slackware, CentOS, FreeBSD
Posts: 3,362

Original Poster
Rep: Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911Reputation: 1911
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, 08:03 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,220

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

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

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, 05:51 PM   #6
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 3,821

Rep: Reputation: 1094Reputation: 1094Reputation: 1094Reputation: 1094Reputation: 1094Reputation: 1094Reputation: 1094Reputation: 1094
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 02:53 PM
Crontab entry to schedule a script every 14 days senrooy Linux - General 12 06-03-2009 08:54 AM
Correct syntax for days in crontab kaplan71 Linux - General 1 03-12-2009 12:46 PM
crontab every 2 days winlinfix Linux - Newbie 4 10-09-2007 09:49 AM
Crontab every 15 days, isn't possible? deqmacrom Linux - General 3 04-07-2005 02:31 AM

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

All times are GMT -5. The time now is 01:42 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