Questions tagged [cron]

Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates.

For information about the most common cron issues and how to fix them, see Why is my crontab not working and how can I troubleshoot it.

1957 questions
0
votes
1 answer

Include executed cron command when outputting to log

Is there a way I can include the command that was executed in the output when I'm logging to a file? For example: * * * * * date && /path/to/php /path/to/script.php >> cron.log 2>&1 Gives me: Wed Oct 2 14:56:50 PDT 2013 output from script How can…
Steve Robbins
  • 1,932
  • 5
  • 23
  • 26
0
votes
1 answer

Crontab issue with specific days execution

We have a cron job under a specific user's crontab which should be running only on working week days. Job was running all days before we changed it. After we changed in the following line the days statement from '*' to '1-5', testscript.sh is still…
fotag
  • 105
  • 6
0
votes
1 answer

Can't stop LAMP graceful restart

I just got my first LAMP up and running, everything works fine except that my server is restarting itself every sunday. When I read the logs I see "Graceful restart requested, doing restart" Should I just let my server do this or should I stop…
lukas
  • 1
  • 1
0
votes
4 answers

wordpress, cron & time - does time on server affects plugins? how to fix it? (virtualbox)

I'm running wp on lamp install in virtual machine. I frequently pause it, save snapshots, etc. Date and time aren't correct because of this and i think i noticed weird behavior of plugins that use cron. How do i fix my time and plugins? Maybe i…
Phil
  • 1,969
  • 6
  • 29
  • 33
0
votes
1 answer

Why won't this shutdown shell script work under root's crontab when the guest user is logged in?

I've got a laptop running Lubuntu 13.04 and guest account enabled. People forget to shut it down every day so I figured I'd just put a one line script into root's cron to solve that. No dice. It shows up in the syslog every day like it ran, but the…
Lido
  • 45
  • 2
  • 8
0
votes
1 answer

cron.hourly script executing multiple times

The setup I have a script /etc/cron.hourly/msm-hourly that contains this: #!/bin/sh LOGPATH='/opt/msm/servers/cronscripts' LOGFILE="$LOGPATH/msm-start.log" # Make restart dead servers echo "" >> $LOGFILE && /bin/date >> $LOGFILE && /etc/init.d/msm…
0
votes
1 answer

How can I check cron task it's running?

I put a cron script in /etc/cron.d: [root@node ~]# cat /etc/cron.d/reconfig 0 */6 * * * root /root/bin/reconfig.pl But I get no list of cron tasks for root: [root@node ~]# crontab -l no crontab for root How can I check it's running ok? It's a…
Zhen
  • 2,159
  • 4
  • 19
  • 31
0
votes
1 answer

cron job not running the script that start vncserver

Hi I wrote a script to start my vncserver when I call it manually via command line. It works as follows: the script is in usr/bin I gave it the right authorization (chmod u+x startvnc) but wen I test it via cron (* * * * * /usr/bin/startvnc) it…
Romuald
  • 1
  • 2
0
votes
3 answers

script bash can't get difference in $PS1 or $- when running interactivelly or via cron

I want my cron scripts being executed verbosly when run interactively by a system user (for debug purpose for instance) and quietly otherwise (for cron, as I want receive e-mail if and only if I get errors). I have tried this in my script: case "$-"…
philippe
  • 2,303
  • 4
  • 32
  • 53
0
votes
2 answers

Can I combine Cron special string "@reboot" with regular scheduling?

In the Cron manpage it mentions the special string "@reboot". Can I combine this with a regular schedule? The goal is simply to schedule a job to run once a day AND immediately in the event of a system reboot.
0
votes
2 answers

How to stop long-running cron process from being killed

I have a long-running cron process, running a Python script, that seems to get randomly killed. In dmesg I see: [230568.077358] init: cron main process (890) killed by TERM signal [237517.974422] init: cron main process (19598) killed by TERM…
Cerin
  • 3,600
  • 19
  • 61
  • 79
0
votes
1 answer

Issue with ifconfig in a shell script (using cron)

If I execute this script manually in Debian: #!/bin/bash /sbin/ifconfig wlan0 down /sbin/ifconfig wlan0 up sudo iwconfig wlan0 essid "WLAN_NETWORK" sudo iwconfig wlan0 key myPassword sudo dhclient wlan0 It works fine. It restarts my wifi adapter…
Janus Gowda
  • 103
  • 1
  • 5
0
votes
1 answer

celery tasks from one domain appear on another domain's django admin hosted on the same box

I have a rather funny problem that I didn't manage to find it elsewhere. I have 2 django-celery projects running with redis on 2 different domains, but apparently hosted on the same box. I don't have sudo access, so I don't use the reddis daemon or…
symbiotech
  • 101
  • 4
0
votes
1 answer

Strange crontab behaviour

This evening I have been playing with cron for the first time, and have started experiencing strange results. The script that I am trying to run is a watchdog that allows me to manage a couple other scripts with a web interface. When I run the…
Butters
  • 105
  • 5
0
votes
1 answer

Cron job does not generate expected log file

I'm trying to execute a shell with crontab. The cron job executes the shell but doesn't generate the log file i need. This is what i'm using for my cron: 10 * * * * /home/user/3nvo.sh This is a simple shell that has the same structure: #!…
darm323
  • 9
  • 1