Ubuntu :: Some Of Crontab Don't Run / Get It To Work?
Aug 19, 2010Figure 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...
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...
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 RelatedLet 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.
I made a rsync backup at crontab, but this rsync backup script does not work.Quote:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
[code]....
In RHEL6 root's account I have crontab job: 30 6 18 4 1 /sbin/init 6 It worked fine on the 18th of April and properly restarted my system, BUT it also restarted my OS at 6:30 on next Monday - 25th of April.
View 2 Replies View Relatedis 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 RelatedI 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)
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 RelatedI 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.
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 RelatedHow to use crontab? i need to set crontab to execute a file every 1 minute
View 2 Replies View RelatedEdit: 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
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?
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
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.
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:
I am a xfce user. I have a list of wallpapers and I wanted to change them every 5 minutes Initially I was using a simple command in crontab entry to change it, Quote: */5 * * * * xfdesktop --reload it was working but it would crash xfdesktop process after few changes and the screen would be all grey. To solve this issues I wrote a simple script which would check if xfdesktop is alive and if yes it would call xfdesktop --reload else start xfdesktop I called this script idesktop & its path is ~/.bin/idesktop
[Code]....
A couple days ago I noticed cron stopped working and now I can't create a new file using crontab -e. When I hit crontab -e I get the editor but after saving nothing comes up under crontab -l and the file is blank when I reopen it. I don't have a cron.allow or a cron.deny.
View 4 Replies View RelatedHave just started to use look at crontab. I could use Scheduled Tasks as well as crontab -e in terminal.
I must have changed something because now Scheduled Tasks just seems to load then dropout. Loading a task through terminal is accepten (crontab -e) but doesn't work.
Pidgin likes to randomly crash on me, and sometimes it takes me awhile to notice. So I thought why not make a script and cron job to see if pidgin is running and restart it if needed. Sounded easy but having all kinds of problems. Here's my cron line...
Code:
*/1 * * * * /home/justin/chkpdgn.sh >> /home/justin/test.log 2>&1
I run "tail -f /home/justin/test.log" to keep an eye on the cron output.
Here's the chkpdgn.sh script...
Code:
#!/bin/bash
SERVICE='pidgin'
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "$SERVICE service running, everything is fine"
else
echo "$SERVICE is not running"
$SERVICE
fi
Running that works fine when I do it, but when cron does it pidgin never starts and I get this error...
Code:
pidgin is not running
error: line 15: bad flag alias index: 0
error: line 15: bad flag vector alias
error: line 16: bad flag alias index: 0
error: line 16: bad flag vector alias
That goes on for quite awhile up to like line 60000 and pidgin runs but doesn't show up in the me menu. Any way to restart pidgin when it crashes?
Not strictly being applied to an Ubuntu distro but Linux all the same.Our company run a database server referenced by a number of mail servers; the database server is very soon to be replaced since it's old, decrepit and not as secure as it should be - indeed, when it decides it's had enough, the MySQL process will simply stop.You can restart MySQL if you need to quite easily; using Putty, I'll connect to the box and run the command:/etc/rc.d/ init.d/mysqld restart
Using /etc/rc.d/init.d/mysqld status you can get a response of either mysqld (pid 8354) is running... or mysqld is stopped - how can I use this information in a script so that mysqld is only restarted if every thirty minutes a check comes back to say it's stopped? this current server is replaced by someone who knows what he's doing in a few weeks but this will ensure less disruption to those who rely on the current incarnation...
My Problem: The output redirection auf a script works if the script is called in the terminal but not when its called via crontab.
My Situation: I have 2 scripts:
~/backup1
Code:
echo backup a to c
rsync -a -v --progress --delete --exclude=.Trash-1000 /path/a/ /path/c/backup/
echo backup b to c
[Code]...
I recently set up some new cron jobs under Ubuntu 10.04 64-bit (all the latest patches as of Nov. 11th) and just happened to check right after one was supposed to run and it hadn't run yet. Checking the logs I found the previous cron job ran exactly one hour later than it was supposed to. Is there something going on with Ubuntu 10.04, cron, and daylight savings where cron pretends daylight savings never happened or something?
View 2 Replies View RelatedCode...
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.
My ISP specifies a time between 2 - 8 am for free upload /download
I would like to stop deluge using crontab at a specified time. How do i do this?
also even poweroffing the system would do..i tried adding a simple poweroff command in crontab under both user and root but it didnt work?
using xubuntu 10.10 and crontab...also have gnome-scheduler installed
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?
I know the crontab format and editing is pretty easy, but I always forget the format. So I would like to have a frontend/gui. As far as I can tell a good one doesn't exist anymore.kcron - what I used to use, no longer exists (and I switched to ubuntu from kubuntu)gnome-schedule - does not show all users, does not allow for fine control that kcron had.Does anyone know a good gui/frontend for crontab? I guess I'm just going to have to get in the habit of researching the file syntax, how to edit it, and editing manually.
View 3 Replies View RelatedCrontab Script Not Running?
View 4 Replies View Relatedi 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 RelatedI administer a desktop computer with ubuntu 8.04 in an university library. Since it works almost all night, to enable students to study, after some time I noticed some misuses of the computer during the evening, when there isn't many students. My goal was to disable users from accessing internet from 7pm to 7am, but also enable it if certain user was logged in (I use that user for torrent, and I seed on that computers from time to time). So I created a script that's being called by root's crontab, and here is the script's code:
Code:
#!/bin/bash
NUM=`who|grep myuser|wc -l`
#echo $NUM
if [ $NUM -le 0 ]; then
/sbin/ifconfig eth0 down
else
/sbin/ifconfig eth0 up
fi
Since I created the script, I actually never seeded anything, so I'm wondering now if that's going to work at all, and (also) is there a better solution for this.