LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-26-2015, 03:39 AM   #1
DelMab
Member
 
Registered: Jun 2015
Posts: 30

Rep: Reputation: Disabled
Add a weekly cron job


Hello

How do I add a disabled cron job which will invoke 'cruft' as part of the weekly job set please?

Thanks for your help
 
Old 11-26-2015, 04:37 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,692

Rep: Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274Reputation: 7274
what have you tried? where did you stuck?
 
Old 11-26-2015, 04:49 AM   #3
DelMab
Member
 
Registered: Jun 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Hi Pan64
I just dont know how to do it as I am knew
Cheers
 
Old 11-26-2015, 04:56 AM   #4
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Please take time to read cron basics.

So you can start asking useful questions.
 
Old 11-26-2015, 07:01 AM   #5
DelMab
Member
 
Registered: Jun 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Thanks mate. is it like this:

crontab -e

00 * * * 0 root /usr/sbin/cruft
 
Old 11-26-2015, 07:16 AM   #6
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Ok that looks like an 'enabled' cron entry. So you want to disable it?
 
Old 11-26-2015, 07:20 AM   #7
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Not sure what distro you are running. In Gentoo there is system crontab - /etc/crontab. It should be edited directly. Running crontab -e as root will add confusion, because it will create a user crontab for root instead.
 
Old 11-26-2015, 08:04 AM   #8
DelMab
Member
 
Registered: Jun 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
#00 * * * 0 root /usr/sbin/cruft

should that not be under /etc/cron.weekly/cruft
 
Old 11-26-2015, 08:30 AM   #9
DelMab
Member
 
Registered: Jun 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Hi Emerson, I am running debian wheezy and i am asked to add cruft cron weekly as part of debian package rebuilding.
 
Old 11-26-2015, 09:58 AM   #10
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
There is a directory /etc/cron.weekly/, you can write a little script and drop it in there. Or edit /etc/crontab.
 
1 members found this post helpful.
Old 11-26-2015, 10:10 AM   #11
DelMab
Member
 
Registered: Jun 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Thanks Emerson, how do I write that script to invoke /usr/sbin/cruft ?
 
Old 11-26-2015, 10:45 AM   #12
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
Look into /etc/cron.daily/ - use one of them as an example.
 
2 members found this post helpful.
Old 11-26-2015, 11:13 AM   #13
DelMab
Member
 
Registered: Jun 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
No idea

I thought on /etc/cron.weekly create a little script:

vi cruft.sh

#!/bin/sh
#cruft #disabled
 
Old 11-26-2015, 11:53 AM   #14
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
I'm still in dark what exactly is your goal. You need a weekly cronjob that is disabled? Then put a working script in /etc/cron.weekly/, but do not set the executable bit.
 
Old 11-27-2015, 06:48 AM   #15
DelMab
Member
 
Registered: Jun 2015
Posts: 30

Original Poster
Rep: Reputation: Disabled
Yeah thanks Emerson. this is it.

on /etc/cron.weekly

vi cruft.sh

#!/bin/sh
cruft

Executable should not be set.
 
  


Reply

Tags
cronjobs, packages


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
[SOLVED] BASH: Add cron job to run hourly worm5252 Programming 9 03-26-2010 10:36 AM
add a job to cron.daily pbxuser911 Linux - Server 9 10-29-2009 12:30 AM
cron.hourly cron.weekly cron.monthly and 0anacron. Are they necessary? glore2002 Debian 2 09-30-2009 08:57 PM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
Can any one plz explain why/what for cron.d, cron.daily, cron.weekly etc are there. mavinashbabu Linux - Newbie 4 09-21-2006 01:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:47 AM.

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
Open Source Consulting | Domain Registration