Server :: Get The Name Of The Script Run By Crontab In The Cronlogs?
Apr 27, 2010
Is there any way to get the name of the script run by crontab in the cronlogs? ex:/test.sh -- this is the cron job and i want to get the name of the script(test.sh) in the cron log after the job is run.
View 1 Replies
ADVERTISEMENT
Apr 27, 2010
I am using Linux 64 bit Redhat Linux. I am trying to setup simple crontab as follow...1. Edited crontab file using crontab -e2. Listed the file once to verify it using crontab -l. This will display as.. 18 5 * * 2-3 ksh $HOME/testScript.sh > $HOME/testscript.out3. Logged in a root and restarted cron deamon using "/etc/init.d/crond restart"As per my understanding now my testScript should start running at 5:18 am Thuesday
View 3 Replies
View Related
Jun 23, 2011
is it possible disabling a crontab job without deleting the crontab description entry (by crontab -e)?I could also accept to change the entry itself. Now it's:0 0 * * 0-6 /home/me/cron/script.csh
View 4 Replies
View Related
Oct 27, 2009
Can any one brief me about technical Differences between schedulers crontab and at ?
View 1 Replies
View Related
Jul 29, 2010
how to schedule shutdown every day using crontab
View 1 Replies
View Related
Jun 17, 2009
I'm setting up a new server and have edited the crontab to a run a script but nothing is happening, is there anything I need to setup to get the crontab working?
View 6 Replies
View Related
Aug 26, 2010
I have a question about using crontab with /etc/crontab...
I had a cron job that I needed to run as root. At the time I thought that sticking it in /etc/crontab would be a good idea. However, I used the crontab command to edit /etc/crontab, which I guess is not standard procedure? Specifically, I configured /etc/crontab as my local user's crontab (i.e. sudo crontab /etc/crontab) then added my cron job as I would a local user crontab (i.e. sudo crontab -e).
Originally, my cron job looked like this:
30 * * * * root /my/batch/script &> /dev/null
After adding the new cron job I started seeing errors. Something to the effect of "can't find command root" or something similar. So I removed the 'root' user definition from the cron job and the job started running fine. However, because this is /etc/crontab, there are other system related cron jobs that have been defined to run under the root account (e.g. "17 * * * * root cd / && run-parts --report /etc/cron.hourly" runs as root, etc.). So these pre-existing system cron jobs, which up until now have been running smoothly, are now generating "can't find command root" errors. But I think that the system cron jobs _are_ successfully being run someplace because logrotate seems to be working.
So what I _think_ is happening is that /etc/crontab is being run twice: once as the system crontab, and once as my sudoed local user's crontab. When I run crontab -l I see nothing, but when I run sudo crontab -l I can see the contents of /etc/crontab. I am reluctant to delete my sudoed local user's crontab, because then in the process I would be deleting the system crontab, and I do not know how I should restore the system crontab's contents. (I am still not sure as to the most appropriate way to edit the system crontab).
How can I get out of this mess? I want /etc/crontab to go back to the way it was before--running _once_ as the system crontab. As for my new cron job, I'm willing to reconfigure it anywhere so long as I am still able to run it as root. Any ideas? (I am using Ubuntu 8.04 Server LTE)
View 2 Replies
View Related
Apr 9, 2011
I have installed an application manager(monitoring application) on my linux server. Now, i need to have backup schedule for my application. The application itself has executive file to backup database.But when i put this file in my crontab to schedule the backup program it wont run!50 09 * * * root /opt/ME/AppManager9/bin/BackupMysqlDB.sh
View 1 Replies
View Related
Jun 6, 2010
i want to create a crontab job by bash scripts:test1 cat /opt/shell/test1crontab on.but i do not want to use this command line ( crontab -e )to add this job.
View 4 Replies
View Related
Jan 13, 2010
For some reason crontab does not work on my system.
Fedora Core 11
I am running from a Virtual Private Server.
Code:
Code:
View 2 Replies
View Related
Aug 10, 2009
Is the crontab saved in case of server restarts?
View 2 Replies
View Related
Aug 3, 2011
I've currently got a crontab line that looks like the following:
Code:
*/5 * * * * /usr/bin/php -q /etc/backend/cron.php | mail -s "Cron script output" whiteydude@gmail.com
The script works fine - it runs every 5 minutes and checks if certain environmental variables are set in place - if they are, it prints an output. If they're not, it dies.
The problem is that when it dies, it still sends me a blank email - one every 5 minutes, every time the cron job runs.
telling it not to send if it's blank?
I'm assuming some type of dirty awk script could do this, but I don't really know my shell well enough to do that.
I'm not good at putting these things into words, so let me write some psuedo code to explain what I mean:
Code:
*/5 * * * * /usr/bin/php -q /etc/backend/cron.php | if (STDOUT != '') { mail -s "Cron script output" whiteydude@gmail.com }
EDIT: Unfortunately I'm running on CentOS, so I can't use mail -E . Apparently that's a FreeBSD thing.
View 5 Replies
View Related
Feb 19, 2011
Having an odd problem running a mysqldump via crontab. I have the script running on other servers and they work fine, so not sure how to actually troubleshoot, but the script looks like the following;
If I run it as a cronjob as root, it finishes in a second and a 20k file is there. If I run it from the command line as root it does the backup (takes a few minutes) but does complete the backup and can be unzipped and read successfully.
View 3 Replies
View Related
Mar 14, 2011
I am using squid 2.6 on my cent os 5 .I want to shutdown the system at 7:00 pm for that purpose I write in# crontab -e 0 19 * * * /sbin/shutdown -h nowThe thing which I want to clear that when the system will going to turn off it will also stop squid service? If not then how can I automatically stop squid service and then crontab file execute
View 6 Replies
View Related
Aug 6, 2009
I'm using crontab for user ABC in a month and have no problem.. But today i want to add new schedule user ABC with crontab.. i found this error
/tmp/crontab.XXXXDYxb6a: Permission denied
so i check with crontab -l command, it can show my schedule.. If I use root, crontab -e and crontab -l work properly..
Note: ls -al /tmp
drwxr-xrwx 8 root root 4096 Aug 6 09:30 .
drwxr-xr-x 24 root root 4096 Jul 19 17:10 ..
drwxrwxrwt 2 root root 4096 Jul 19 17:20 .font-unix
View 1 Replies
View Related
Jan 27, 2010
I created a file which in I tried both :
Code:
MAILTO=""
* * * * * /var/www/scripts/script.php >> /dev/null
[code]....
View 5 Replies
View Related
Jul 10, 2009
I've just discovered that crontab is creating a new file in the root directory every time it executes a cronjob, and it doesn't erase over the old file so there are thousands of files in the root directory, they have the same name as the script file (appended with a numeral) but are all blank.here is what one of the cronjob's looks like[URL]
View 10 Replies
View Related
Jul 21, 2011
I was trying to write a crontab entry using "crontab -e"
Code:
0 0 * * * cp /var/log/httpd/domains/mydomain.net.log
/home/admin/logs/mydomain.net.log
crontab is giving me this error:
Code:
"/tmp/crontab.XXXXfMOnRS":2: bad minute
errors in crontab file, can't install.
I've tried a dozen different values for the minute, but it's still giving me the same error.
View 5 Replies
View Related
May 29, 2011
What is the difference between the crontab located in /etc/crontab and the crontab that can be edited using crontab -e?
View 2 Replies
View Related
Apr 12, 2011
I have a tiny shell script to rsync files between two servers and remove the source files.
This script works fine, when it has been initiated manually or even when the rsync command is executed on the command line.
But the same script doesn't work, when I try to automate it through crontab.
I am using 'abc' user to execute this rsync, instead of root, as root login to servers are restricted in all of our servers, by us.
As I mentioned earlier, manual execution works like charm!
When this rsync.sh is initiated through crontab, it runs the first command(chown abc.abc ...) perfectly without any issues. But the second line is not at all executed, and there is no log entry i can find at /mnt/xyz/folder/rsync.log.
View 6 Replies
View Related
Sep 1, 2010
How to use crontab? i need to set crontab to execute a file every 1 minute
View 2 Replies
View Related
Feb 1, 2010
I want to run a crontab job but it isnt working. I am writing in the crontab file with crontab -e Then I am waiting time but it isnt working. code...
View 6 Replies
View Related
Aug 6, 2010
No matter what I try I just cant get cron working for me on my Squeeze setup I can type /usr/bin/soffice and openoffice will fire up no problem but put into a crontab and nothing for instance just to test if crontab is working I have this/5 * * * * /usr/bin/sofficeIn y user crontab but nothing happens I have run as root crontab -u djt crontab And after editing the crontab with crontab -e it says it is installing crontab but it just does nothing Unfortunately I am connected to my works network so unable to receive internal mail from cron so cant find any reason for it not working
View 4 Replies
View Related
Jan 10, 2010
Let me first start by introducing myself. I'm completely new to Linux. I've always argued Windows was better, even if I secretly thought not. Anyways the time has come to make the transition (I'm moving into computer forensics so I need to learn linux )
SO i'm trying to use crontab -e. I've installed gnome scheduler as I'm not comfortable editing in command line yet.
I've setup blackjack to start everyday at 23.30. The command line I've entered is /usr/games/blackjack and this works perfectly fine in command line.
View 2 Replies
View Related
Jan 21, 2010
Edit: commands like Firefox works after I set it to display properly. I still can't get personal scripts to run, though.I can't seem to get crontab to run my commands. I add
Code:
* * * * * /home/username/script
but it doesn't seem to work. The script works itself in the shell
View 1 Replies
View Related
Mar 2, 2010
I want to schedule a Java program to run at a certain time, which will open a GUI progress monitor while it runs, and then terminate when it's done. I can execute it fine from the command line, but I it doesn't seem to work when I schedule it with crontab. In fact, I can't make any gui by scheduling it, not even something like gedit or firefox.
I know it's pretty rare that someone would want to do this, but is there any way to schedule a GUI app?
View 1 Replies
View Related
Jun 16, 2010
I'm having problems trying to restart gdm from crontab and I'm not sure what I'm doing wrong. Basically what I want to do is a 'logout' every morning before I get to work so that by the time I get to my computer I would just have to log back in and have a fresh gnome session.
The command I'm using to restart gdm is:
Code:
/usr/sbin/service gdm restart
If I run this command from a terminal as root it works.
To edit my crontab file I'm doing:
Code:
sudo crontab -u root -e
And adding the following line to it:
Code:
25 08 * * 1-5 /usr/sbin/service gdm restart
My understanding is that this should restart gdm every day of the work week (Mon-Fri) at 08:25. But for some reason this is not happening.
I also checked that my cron deamon is running by:
Code:
~$ service gdm status
gdm start/running, process 27156
View 5 Replies
View Related
Aug 4, 2010
I have a .sh file which i want to run using crontab at a specific time with root privilege.
I put an entry in root's crontab as the following:
sh /home/vivek/ifconfig/college.sh
But, the file do not get executed at a given time.
View 1 Replies
View Related
Aug 19, 2010
Figure out why this /etc/crontab won't run correctly?
Is it possible that it don't run because the cron deamon is not running? code...
View 1 Replies
View Related
Feb 14, 2011
I'm currently trying to have crontab to automatically backup files from ramdisk. It works perfectly when I run it myself by simply cd:ing to scripts directory and type ./save_world.sh.
The problem is, that crontab DOES (at least it looks like it) run that command every one minute. /var/log/syslog does show it executing that line every one minute without any errors. I'm currently very confused what I did wrong here. I have tried rebooting, fiddling with crontab line, tried sudo crontab -e but nothing seems to work.
My script is called save_world.sh and it is located in /home/phoe/minecraft/rpg/
Code:
My crontab -e has one line and it is following:
Code:
I haven't determined any specific time yet, because I'm just trying to get it work first.
Snippet from /var/log/syslog:
Code:
View 4 Replies
View Related