LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 01-09-2008, 09:43 PM   #1
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Rep: Reputation: 16
'cron' and 'at'


I know that both 'cron' and 'at' commands are related to executing some command at a particular time. But I don't know how to use them. I tried to man it but it was not detailed enough for me to learn.

Can anyone briefly explain how to use them? What's their difference? When to use which?

For example, if I want to generate a text file name 'touch_this.txt' in my home folder at 23:00 tonight. (ie. execute "touch ~/touch_this.txt"). How should I do this using either/both "at" or/and "cron"?

Thanks very much.
 
Old 01-09-2008, 09:52 PM   #2
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
at executes the command(s) given to it once at a specified time on a specified date.
cron executes the command(s) given to it repeatedly at a specific time or date every day, week or every month. That's pretty much the difference between the two.
 
Old 01-10-2008, 12:08 AM   #3
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
I expect that the log file for "cron" to be found in/var/log/cron but I cannot find this file in my system. Is this related to my distro of Linux? I am using Ubuntu7.10. Where can I find the log file?
 
Old 01-10-2008, 12:25 AM   #4
Uncle_Theodore
Member
 
Registered: Dec 2007
Location: Charleston WV, USA
Distribution: Slackware 12.2, Arch Linux Amd64
Posts: 896

Rep: Reputation: 71
Have you checked /var/log/crond? There are several possible setups, yes, it might depend on a distro.
 
Old 01-10-2008, 02:28 AM   #5
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
I've checked, but found nothing related.

Quote:
ls /var/log/*cron*
give me nothing.
 
Old 01-10-2008, 05:21 AM   #6
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Check /var/log/syslog or /var/log/messages. Cron logging is marked with [CRON]

jlinkels
 
Old 01-11-2008, 01:12 AM   #7
lawrence_lee_lee
Member
 
Registered: May 2007
Posts: 141

Original Poster
Rep: Reputation: 16
Thanks! I've finally found it!
 
  


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
adding a perl script to cron.daily / cron.d to setup a cron job CrontabNewBIE Linux - Software 6 01-14-2008 08:16 AM
using 'at' and 'batch' command harry_0098 Linux - Newbie 1 10-30-2007 10:07 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
use 'at' to run x apps? florestan Linux - Software 6 04-14-2003 03:18 PM

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

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