LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   crontab (https://www.linuxquestions.org/questions/linux-newbie-8/crontab-290030/)

mytinytown 02-14-2005 08:02 AM

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

bumjubeo 02-14-2005 08:21 AM

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 :)

mytinytown 02-14-2005 05:14 PM

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

mytinytown 02-17-2005 07:38 AM

System issues caused this not to work.

Reinstalling system with Fedora Core 3


All times are GMT -5. The time now is 06:58 PM.