LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-14-2005, 09:02 AM   #1
mytinytown
LQ Newbie
 
Registered: Feb 2005
Location: Michigan
Distribution: Fedora Core 2
Posts: 6

Rep: Reputation: 0
crontab


I am trying to make a crontab that will log my Linux uptime each day.

It looks something like

30 22 * * * /usr/bin/uptime &> /var/log/uptime.txt

This should log @ 10:30 PM my PC uptime in the uptime.txt file, right?

I googled for answers and can not find anything, hoping someone here can help.

It did not seem to work, I was told that it would auto build the TXT file as well. Any input would be just great.

Thank you,
Joe
 
Old 02-14-2005, 09:21 AM   #2
bumjubeo
Member
 
Registered: Jan 2005
Distribution: Slackware, Fedora Core
Posts: 35

Rep: Reputation: 15
This is what I would do, instead vi(or what ever you use to make a text file) a file and call it something like "cron.uptime"

30 22 * * * /usr/bin/cron.uptime >> /var/log/uptime.txt

You dont need the & in there.

and then in command line type:

# crontab cron.update

and then it should run

The problem you might be having is that you did not make this crontab as root, and you wouldnt have permissions to write /var/log/
So either make this crontab as root, or make it write to somewhere else
 
Old 02-14-2005, 06:14 PM   #3
mytinytown
LQ Newbie
 
Registered: Feb 2005
Location: Michigan
Distribution: Fedora Core 2
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
The problem you might be having is that you did not make this crontab as root, and you wouldnt have permissions to write /var/log/
So either make this crontab as root, or make it write to somewhere else
OK I set this file up in Konsole and was logged in su, is that root? I am very slow at picking up Linux, but I been using it alot more lately and wanting to learn.

Thank you, Joe
 
Old 02-17-2005, 08:38 AM   #4
mytinytown
LQ Newbie
 
Registered: Feb 2005
Location: Michigan
Distribution: Fedora Core 2
Posts: 6

Original Poster
Rep: Reputation: 0
System issues caused this not to work.

Reinstalling system with Fedora Core 3
 
  


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
crontab x2??? killahsmurf Slackware 2 05-24-2005 11:53 PM
Crontab wormraper Debian 4 05-15-2005 02:01 AM
How to use crontab ? Dakkar Linux - Newbie 2 01-22-2004 11:49 AM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 01:35 PM
HELP!! crontab karleong Linux - General 9 07-12-2003 11:54 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:50 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration