Ubuntu Servers :: Crontab Not Running Script?

Jan 27, 2011

Cron seems to be running the script below (According to /var/log/syslog) but I'm not receiving the email it should send. This does work when I invoke it manually. checkraid (-rwxr-xr-x 1 root root)

Code:
#!/bin/bash
echo `/sbin/dmraid -s > /etc/check-raid/check_state`
index=0
while read line; do

[Code]...

View 3 Replies


ADVERTISEMENT

Ubuntu Servers :: After Using Crontab With /etc/crontab / Giving Error "can't Find Command Root"?

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

General :: Crontab Not Working \ Edited Crontab File Using Crontab -e?

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

Ubuntu :: Crontab Script Not Running / What To Do?

Dec 8, 2010

Code...

I opened "crontab -e" in the Terminal and in nano I copied and pasted the first line of this copied script, leaving all the notated lines out. Each time I manually run changer by clicking and selecting "Run" it changes my Wallpaper but this does not happen automatically no matter how many times I reboot.

View 3 Replies View Related

Ubuntu :: Crontab - None Of Job Apparently Running

Jun 1, 2011

I have the following set up in my crontab:

Code:
# crontab -l
# m h dom mon dow command
*/5 * * * * /usr/bin/perl /usr/local/bin/perl/managed_arp_data.pl >> /var/log/arpdb.log
*/5 * * * * /usr/bin/perl /usr/local/bin/perl/infoblox_fixed_sync.pl >> /var/log/crossref.log
00 23 * * * /usr/bin/perl /usr/local/bin/perl/infoblox_host_sync.pl >> /var/log/host_sync.log
0 * * * * /usr/bin/perl /usr/local/bin/perl/infoblox_excl_sync.pl >> /var/log/excl_sync.log

None of these jobs is apparently running, however they did run on the 31st (yesterday), but not on the 30th or any other day during the last 10 days that I have logs for. I think I've set cron to run at log level 1, but I don't know where that log goes, I don't see anything like /var/log/cron

So, couple questions:
* If I do something like "sudo -s" to get a root prompt and then do a "crontab -e", which user does that crontab get executed as?
* Where should I look for cron logs?
* Anyone know why a job would run on the 31st, but not any other day?

View 1 Replies View Related

Ubuntu :: Crontab Script Not Running / Fix This?

Dec 8, 2010

Crontab Script Not Running?

View 4 Replies View Related

Fedora :: Running Script Using Crontab?

Jul 26, 2010

I have a problem using crontab. I have a C file which invokes a linux command. I want to execute the file using crontab. Its like whenever the system boots up and contents gets loads i want to execute this script. The problem is I don't know how to run the script using crontab. For eg if the file is present under /home/user/first.c . In order to execute this script whenever system starts wat wil be my command

View 7 Replies View Related

General :: Running Scripts From Crontab

Nov 1, 2010

Im new to linux, using ubuntu 10.04. I have been playing around with crontab and have no problems scheduling a job which runs a script file containing the following command:

However, when I try to do the following in the script file nothing happens..

Similarly the following doesnt do anything either:

Is there something im missing?

View 5 Replies View Related

General :: Crontab Not Running Php Script?

Apr 18, 2011

I have a crontab that is supposed to run 2 PHP scripts but they never run.

30 */3 * * * php /var/www/html/mkimages.php
0 */3 * * * php /var/www/html/import_historic_data.php

Both of these files are owned by root, is it a permissions thing? How can I get get cron to run the files?

View 13 Replies View Related

General :: Crontab Not Running Script?

May 17, 2010

I put below line in a sh file

#!/bin/bash
HOSTS=172.16.14.1
COUNT=4

[code]...

View 5 Replies View Related

General :: Crontab Is Not Running Script

Dec 20, 2010

I'm trying to get myself familiar with bash scripting.I created a script to delete all files and folders in a specific directory, and made an entry in crontab.Crontab will not run the script, but I can run it manually.

View 2 Replies View Related

General :: Perl Jobs Are Not Running From Crontab?

Nov 30, 2010

I am having a shell script which runs perl jobs.The script is starting the perl jobs when it is executed manually from the command line , but when the same script runs from crontab it is not starting the perl jobs.I have these things in the begining of the script

. /etc/profile
export MDX_HOME=/home/entsms
source $MDX_HOME/.bash_profile

[code]....

View 1 Replies View Related

Software :: Crontab Entries Running On Even And Odd Weeks

Sep 24, 2010

I'm using crontab to start and stop music playback (its like start and end of a brake in school). The problem is that some of the entries should be run on even weeks and some on odd.
exp:

This should be played on even weeks
00 08 * * * audacious -p
10 08 * * * audacious -u
and this on odd
05 08 * * * audacious -p
15 08 * * * audacious -u

There are about 20 entries for even and 20 for odd. I found here on the forum that maybe this should work but for it is not working for me
00 08 * * * [[ $(expr `date +\%W` \% 2) = 0 ]] && audacious -p
If I put it like that its not working at all

View 7 Replies View Related

General :: Crontab Syntax - Running Script Once Every Five Minutes

Jan 25, 2010

I am planning on running a script once every five minutes, and the syntax that comes to mind in doing this is the following:

Code:
5 10 15 20 25 30 35 40 45 50 55 * * * * /apps/<script>.pl
Is there a better syntax to use to accomplish this task, or is the above example the way to go?

View 2 Replies View Related

General :: Restart The Crontab, If Change The Script Which Was Running?

Aug 24, 2010

that If I am fire a crontab which is running myScriptThe crontab is runningNow if I change the source code of myScriptDo I need to restart the crontab, to take into effect mychanges Ie I want in the existing crontab to take my updated script

View 2 Replies View Related

Software :: Script Not Running Via Crontab, Run's Fine Manually?

Feb 8, 2010

Yes I have tried exporting my paths and variables aab still will not run my script. 'm sure I am doing something wrong.I have a shell script which runs a jar file. This is not working correctly. After reading around I have read this is commonly due to incorrect paths due to cron running via it's own shell instance and therefore does not have the same preferences setup as my profile does.here is what my script looks like today after several modifications:

Code:
#!/bin/bash --
. /root/.bash_profile

[code]...

View 10 Replies View Related

SUSE / Novell :: Shell Script Not Running From Crontab?

Jan 11, 2010

I have a shell script which is configured for the user. The main task of the shell script is to email certain user with a particular result.

The shell script runs perfectly when run from a Konsole terminal and configured through a crontab generates empty entries.

Below is my crontab for my user.

Code:
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXSyNyp1 installed on Wed Jan 6 09:14:14 2010)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
#!/bin/bash

[Code].....

View 3 Replies View Related

Ubuntu Servers :: How To Start Xampp From Crontab

Apr 5, 2010

i want to Xampp run and start all time when i start pc. i don know correct command for use crontab when i want to use it i must delete ># m h dom mon dow commandor not ?

View 2 Replies View Related

Ubuntu Servers :: Crontab Omission Of One Every Month?

May 25, 2010

I set a backup copy of your home computer. I have a problem. A copy of the full exercise once a month

Code:

15 22 1 * * / root / scripts / bcsys.sh full

incremental and would like to do on a daily basis since 22, but aside 1 day each month when it comes to full

Code:

00 22 * * * / root / scripts / bcsys.sh incremental

How can this be set and whether there is a possibility?

View 1 Replies View Related

Ubuntu Servers :: Make A Crontab To Email Log Files?

Jul 28, 2010

I would like to make a crontab task to email a log file to me every night.

How would i do this? I know how to make crontab jobs (and sett the time on them), i just dont know the command i would write for this particular job.

View 1 Replies View Related

Ubuntu Servers :: Crontab Or Other (script) To Automatically Replace File?

May 18, 2011

I have been searching for a few hours now trying to figure out the best way to have Ubuntu Server 8.10 copy and replace a file every week.

So for example:

File A (original file)
File B (replacement file)

I would want to copy File B from its location and replace File A each week automatically with out removing or destroying File B.

I've thought of doing a cron since I already have a job set for email piping. but I'm unsure of the best way to complete this task.

View 5 Replies View Related

Ubuntu Servers :: CronTab Not Executing Script Works Fine Manually?

May 9, 2011

I have written a simple backup script, and added it to CronTab, but it doesnt execute at all. Here is my script: [URL]...And my CronTab entry: 0 */2 * * * root /home/server/Scripts/backup.sh

View 6 Replies View Related

Ubuntu Servers :: Setting Crontab Not Send Mail Notification To Owner?

Jul 2, 2011

How to set crontab not send mail notification to the owner script if the script success running? because I'm monitoring mail server, and notification from cron is not necessary for me. I'm using ubuntu 10.04 server

View 4 Replies View Related

General :: Possible Disabling Crontab Job Without Deleting Crontab Description Entry

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

Fedora Servers :: Crontab Backup Job Works / But Gives Chown / Chgrp Errors

Jul 3, 2010

As root, I use crontab to run mirrordir to backup directories. Everything gets copied over properly, but owner information isn't preserved and root is the owner of all the backed up files. I can deal with that, but crontab reports tons and tons of chown/chgrp errors for mirrordir every time I do back ups--which is every day--and the multiple emails to root of thousands of chown/chgrp errors is very annoying. The error is "Operation not permitted," but that doesn't make sense to me because the job runs as root (right?) and clearly the job is permitted to create the backup files, so why would it fail to chown and chgrp?

I've had the exact same setup on another server for years, and crontab has always run mirrordir without error. Any suggestions how to clear the errors on my new server?

View 14 Replies View Related

Red Hat :: Running IPmonitor To Monitor The Disk Usage On Our Servers - Running Df -h

Mar 19, 2010

We are running IPmonitor to monitor the disk usage on our Linux servers. It does not seem to coincide with what is reported when running df -h. For example on a Red Hat 5.3 server - our IPmonitor shows that 85% is used on the /usr partition, however when I do a df -h on the server it shows that 91% is used. Why there would be a discrepancy? IPmonitor uses SNMP.

View 5 Replies View Related

Software :: Scheduling Backup In Crontab When Put This File In Crontab To Schedule The Backup Program It Wont Run?

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

Ubuntu Servers :: Crontab "randomly" Doesn't Execute

Aug 23, 2010

I am running ubuntu 10.04 as a web/file server. I have set up several cron jobs in the past which until recently were executing normally. However, a few days ago, cron jobs stopped executing after a restart. I was able to fix the problem by deleting and reentering the cron jobs, but only until the next restart. ps -ef lists cron.

Summary:
1.) Cron was working --jobs executed without error and restarts worked fine
2.) Cron jobs stopped executing after a restart about a week ago --ps -e still lists cron
3.) Removing all cron jobs and reentering them by copying and pasting fixes until next restart
4.) Cron job syntax is known to be correct since they were executing before this problem arose.

View 5 Replies View Related

Ubuntu Servers :: Redirecting Ports For Running Two Web Servers

Sep 5, 2010

I am running apache2 and tornado web servers on the same server with one ip address.

The apache2 listens on port 80. Tornado listens on port 8888. I want to redirect requests from a specific ip port 80 to port 8888. I don't have the ability to change the port request on the device. It wants is looking for a web server on port 80.

Any other web server request should go to the apache.

I tried adding the following to /etc/ufw/before.rules

When I run iptables -L it doesn't appear. I have disabled and enabled ufw with no help.

View 3 Replies View Related

Fedora :: Write A Crontab Entry Using "crontab -e"

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







Copyrights 2005-15 www.BigResource.com, All rights reserved