LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 12-03-2010, 11:30 AM   #1
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Manjaro
Posts: 837

Rep: Reputation: 96
Problem with cron


I'm running a Slackware64 13.0 machine with the following line at the end of crontab -e:

Code:
@reboot rm -rf /tmp/*
Yet /tmp is not clearing. This exact same setup is working fine for me on two 13.1 boxes and a -current machine; what gives?
 
Old 12-03-2010, 12:49 PM   #2
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Is this command in the crontab of a user or root. If it's a user's crontab then there may be a problem as the command will be ran as that user and maybe failing. Don't know why the other machines are working OK though. Personally I'd always put such stuff in /etc/rc.d/rc.local_shutdown anyway. I'd start by looking at permissions and ownership of stuff in /tmp/ and who owns the crontab on all machines.
 
Old 12-03-2010, 12:51 PM   #3
2handband
Member
 
Registered: Jan 2009
Location: Alexandria, Minnesota
Distribution: Manjaro
Posts: 837

Original Poster
Rep: Reputation: 96
Quote:
Originally Posted by bgeddy View Post
Is this command in the crontab of a user or root. If it's a user's crontab then there may be a problem as the command will be ran as that user and maybe failing. Don't know why the other machines are working OK though. Personally I'd always put such stuff in /etc/rc.d/rc.local_shutdown anyway. I'd start by looking at permissions and ownership of stuff in /tmp/ and who owns the crontab on all machines.
It's the root crontab.
 
Old 12-03-2010, 01:13 PM   #4
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
Quote:
It's the root crontab.
Hmm - not that then. Just to let you know - I tried putting a command in my crontab like so:
Code:
@reboot date > ~/reboottime
I'm running Slackware64 13.1 and it definitely works on my machine.
 
Old 12-03-2010, 01:25 PM   #5
brixtoncalling
Member
 
Registered: Jul 2008
Location: British Columbia
Distribution: Slackware current
Posts: 403

Rep: Reputation: 67
Someone posted a similar question here once and if I recall correctly, there was no space between the rm and the -rf. So maybe check your syntax to make sure there's no typo?
 
Old 12-03-2010, 01:25 PM   #6
T3slider
Senior Member
 
Registered: Jul 2007
Distribution: Slackware64-14.1
Posts: 2,367

Rep: Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843Reputation: 843
Make sure crond is running (`ps aux | grep [c]rond` should do the trick), make sure the command is listed properly in the output of `crontab -l`, try adding/removing a blank line at the end of the file, and try using the explicit path to /bin/rm. Also note that your command will not remove dot files in /tmp.
 
  


Reply



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
cron.hourly cron.weekly cron.monthly and 0anacron. Are they necessary? glore2002 Debian 2 09-30-2009 08:57 PM
Cron appears to be messed up (E: cron: subprocess post-installation script returned e bujutsukai Linux - Newbie 1 07-24-2008 03:39 AM
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
cron not working from crontab nor form /etc/cron/cron.d. What did SuSE change? JZL240I-U SUSE / openSUSE 11 01-04-2007 01:57 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 - Distributions > Slackware

All times are GMT -5. The time now is 04:56 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
Open Source Consulting | Domain Registration