I was learning and experimenting with crontab today.
The default editor was just too difficult for me to figure out which caused me to remove my crontab by running crontab -r.
Now, when I run crontab -e and input my new cron task, nothing happens.
I suspect it's the crontab -r command I executed earlier.
Can anyone help, please?
I've created a crontab to run a php script (daemon) at boot.
crontab -l:
Code:
(at)reboot /usr/bin/php-cgi /var/backbone/fork_sema.php 2>&1 > /dev/null
hi everyone
how can i use crontab and top for record information about cpu in a file?
i wrote this command in crontab:
#crontab -e
*/5 * * * * top >> test.txt
is that right?
how can i recored cpu usage of processes like oracle in top and print in a file?thanks in advance
Thanks for the tip, I did not think of looking there.I've created crontab in /etc/ with command "sudo touch /etc/crontab".But it looks like it did not help.
Hi guys!
Consider the following PERL script,
Code:
#!/usr/bin/perl
my $userID = `whoami`;
open(TMP, ">user.txt");
print TMP "$userID";
close(TMP);
Run on the command line it works no problem.
Run using crontab it doesn't work.
Where do I go to check errors from crontab?
I've read things about the cron ENVIRONMENT which I don't understand.
Could someone
Code:
Welcome to Ubuntu 11.04 (GNU/Linux 2.6.32-042stab037.1 x86_64)
user@server:~$ crontab -e
no crontab for user - using an empty one
Select an editor. To change later, run 'select-editor'.
1. /bin/ed
2. /bin/nano <---- easiest
3. /usr/bin/mcedit
4.
My favorite editor is vim, but some others prefer nano, or emacs, nano reminds me WordStar, anyway.
Cron job default editor which is invoqued by the command crontab -e is vi, while I prefer vim, and you may prefer nano, you can use this command.
env EDITOR=nano crontab -e
or as I usually do:
env EDITOR=vim crontab -e
I have a strange thing (i think),
I added a line in my crontab on an QNAP NAS with crontab -e i saved (:wq!)
This line would have had a script to run for every 5 minutes so i dit 5 * * * * and the script name.
And restarted the crontab.
This script fills a database.
Last night i quit trying, went to bed and kept de NAS running.
And wen ik woke up this morning i looked at the database and the scr
Quote:
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
#
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
#
# For more information see the manual pages of crontab(5) and cron(8)
#
# m h dom mon d