Cron is a job scheduler that allows users to run commands periodically.

learn more… | top users | synonyms (1)

2
votes
2answers
45 views

How to make my bash script be able to create an log file for a clamscan running in cron?

I've created an custom clamscan(clamav) in bash and when I run it in my shell everyhing is fine, but if I run it in a cron, it can't create the log file. This are the errors: ...
1
vote
1answer
2k views

sh script will not execute as root (cron)

I have the following script added to cron. If I add touch thisisatest.file to the first line it will create a file named thisisatest.file, but not execute the rest of the code. If I manually type ...
0
votes
1answer
11 views

Why is there an apt-get script set in my cron.daily, I'm on Fedora 20?

I found this file tonight: /etc/cron.daily/apt.cron #!/bin/sh [ ! -f /var/lock/subsys/apt ] && exit 0 [ -f /etc/sysconfig/apt ] && . /etc/sysconfig/apt [ $CHECK_ONLY == "yes" ] ...
2
votes
3answers
789 views

set up local mail delivery to user from cron script

A line in my cron.daily script not work as expected. I haven't any special smtp mail server in system, this line rsync -avun --inplace /oneuser/file.xls /otheruser/file.xls| mail -s "$0 $?" ...
0
votes
1answer
32 views

CRON job to check if PHP script is running

I am having trouble regarding CRON jobs, I've basically got two php scripts that I want to keep running continuously on my server. Currently I am using an infinte loop to keep them going but they seem ...
0
votes
1answer
4k views

How to use Crontab for a java file in linux

How can I use Crontab in Linux specifically for a Java program? I want to run a MIS Script. How can I crontab it and what should the path be?
0
votes
1answer
33 views

openSuse, not running the cron job

I have created a cron job in the /etc/cron.d/dispatchingEmail_I the permissions of dispatchingEmail_I are the following: -rw-r--r-- 1 root root 84 Sep 11 19:52 dispatchingEmail_I content of ...
1
vote
3answers
46 views

Using nohup to keep a script running indefinitely

I am very new to Linux and I've only been using it to SSH to my web server using Putty. The issue I am having is this: Basically I've got 2 php scripts. One get_tweets.php constantly listens for ...
0
votes
1answer
14 views

Unable to install crontab on OpenSuse

I am running the following command as root, on OpenSuse: linux-gn77-PC:/home/harbir/project # crontab -e when the editor opens up I type the following, as I want the command to be run at 2145 hours ...
1
vote
1answer
22 views

Execute All Cronjobs in ~/.zshenv Environment

I want to execute all cronjobs in the environment defined in my ~/.zshenv, and I want to redirect STDOUT and STDERR of every cronjob to a single log file. I am on OS X 10.9. What is the cleanest way ...
2
votes
1answer
15 views

Send cron mails to root bundled every hour

Sometimes when there's a problem on my server, I get hundreds of emails in my root account which are caused by cron. I want to be notified about those problems but isn't there a way to bundle those ...
6
votes
2answers
5k views

crontab's @reboot only works for root?

man 5 crontab is pretty clear on how to use crontab to run a script on boot: These special time specification "nicknames" are supported, which replace the 5 initial time and date fields, and ...
2
votes
1answer
16 views

Incorrect cron for midnight?

I checked the crontab set by the hosting company and they have this: 0 * * * * /usr/bin/php /www/sites/[domain.com]/files/html/shell/indexer.php reindexall Does this cron run constantly or once at ...
5
votes
5answers
3k views

Check if script is started by cron, rather than invoked manually

Is there any variable that cron set when it's running a program ? If the script is running by cron, I'll skip some parts; otherwise invoke those parts. How can I know if the bash script is started by ...
2
votes
1answer
24 views

Qt program not invoked by cron

I had a simple Qt program, when running, it shows a simple window with a countdown timer. If you might be interested in the code, please see here. I had crontab line * * * * * ...
0
votes
1answer
25 views

How to create CronJob for running commands on reboot?

Via my host I have SSH access and a control panel. I installed Rails via SSH on a light weight server. I want to reboot the server when it goes down. I think I need to start it manually since I want ...
0
votes
1answer
43 views

Run screen command with variable & tick through cron (cron run .sh)

I run screen command through cron, where the codes is in lorem.sh files. This is cron codes: * * * * * cd /home/z; ./lorem.sh Inside lorem.sh: screen -S screenname -X stuff $'\033[B' sleep 1 ...
1
vote
1answer
38 views

How can I periodically check if my network is up and reconnect if not?

I've written a script to periodically check whether my network is up by pinging three major sites and disconnecting and then reconnecting my network if all three fail. This script works fine from the ...
0
votes
1answer
47 views

crontab entry for a command to run every week and three months?

What would be my crontab entry for a command which I want to run every week. I don't want to run any command between 8 PM till 5 AM and any random day is fine. Similarly what would be my crontab ...
1
vote
2answers
73 views

Can I configure error notifications on a specific cronjob entry to go to a different email address?

I have multiple cron job entries configured under a single account: 0 0 * * * /foo/foo.sh 0 2 * * * /foo/foo2.sh 0 4 * * * /foo/foo3.sh Right now, if any of these encounter an error, an email is ...
0
votes
0answers
17 views

How to prevent cron emailing on termination

Whenever one of my cron scripts finishes, I get an email saying /bin/bash: line 1: 19653 Terminated <command>. How do I prevent this email being sent? I suspect it might only happen when the ...
2
votes
1answer
77 views

Running services without sudo

I want to run a nodeJS web server on a couple of machines which I don't have sudo access on. What would be a good way to do this? The two requirements are: running the service without being ...
1
vote
4answers
13k views

crontab -e , then 0 * * * * = every hour; then xclock

After sudo crontab -e (it wrote "/tmp/crontab.XXXX70pN9h" 1L, 19C 1,1 All Then I saved the file. And to check..? (how? i don't know) And to check I ps -e | grep cron 29818 ? ...
0
votes
2answers
30 views

confuse about User:Group what is the best for /var/www, and Crontab user?

I'm new on linux server. I have 2 question that I'm confuse about this. 1 1. user:group now I chown my /var/www/html like this. my nginx.conf is set server{ user www-data } and in terminal I set ...
2
votes
1answer
50 views

How can I pass a filename containing percent signs (%) as a parameter to a shell script in cron? [duplicate]

We have currently setup a cron job for our new script as below: 46 22 * * * /gzm_common/diagbat9/global/prod/chgstatus.sh /backups/diagbat9/Demantra/output/SK_ITEM_EXTRACT_MFGPRO_$(date +%m%d%y).txt ...
1
vote
2answers
244 views

crontab error with (No MTA installed) but I use >/dev/null 2>&1

I'm new on linux user I try to run crontab to backup my database with vagrant user * * * * * /usr/bin/mysqldump -h localhost -u root -p root mydb | gzip > /var/backup/all/database_`date ...
0
votes
2answers
48 views

How to set cron job for system

I'm really new on Linux and have no any previous experience on it. And I opened this account to ask this question. I need to install a cron job I've followed the short guide here. Well, I think it ...
11
votes
3answers
10k views

Manually run a cron job / simulate running cron job?

I am new to cron and I want to test if cron's mailing stuff after an executed task and things like that work. Is there a more elegant way to test this, then setting a cron job to run every few ...
1
vote
1answer
111 views

Reboot when no network connection does not work!

I have a Raspberry Pi that I use as a NAS for my local network. It works fine, but when I turn off the router to which the pi is connected, it permanently loses the connection. To be able to connect ...
2
votes
3answers
3k views

How do I find out why cron is not running my jobs?

I'm using Ubuntu 14.04, and the cron daemon is running: # ps ax | grep cron 822 ? Ss 0:00 cron but it is not executing any jobs. I was previously getting entries in /var/log/syslog such ...
3
votes
2answers
486 views

Use /etc/aliases for outgoing mail relayed by postfix with local domain

I'm using Ubuntu 12.04 with postfix configured as satellite system that relays outgoing mail to Gmail. For sake of example, my registered domain is example.com I want root cronjobs' error output to be ...
1
vote
0answers
34 views

systemctl to start cron-like job

In /etc/systemd/system directory I have: rsnapshot-backup.service file, with following content: [Unit] Description=rsnapshot backup automation [cron like] [Service] Nice=19 IOSchedulingClass=2 ...
10
votes
4answers
9k views

How do I completely silence a cronjob to /dev/null/?

On my Ubuntu-Desktop and on my debian-server I have a script which needs to be executed each minute (a script that calls the minute-tic of my space online browsergame). The problem is that on ...
5
votes
2answers
5k views

cron ignores variables defined in “.bashrc” and “.bash_profile”

I have defined "SHELL" variable in /etc/crontab file: [martin@martin ~]$ grep SHELL /etc/crontab SHELL=/usr/local/bin/bash [martin@martin ~]$ file /usr/local/bin/bash /usr/local/bin/bash: ELF 32-bit ...
0
votes
1answer
46 views

How to start a cron task?

It sounds really simple, but many times I was stuck at the beginning of learning a new command. The tutorial writer think it's natural to start, but it's not. This is the tutorial I've been reading: ...
15
votes
3answers
941 views

How can I start a cronjob 1 hour later each day?

I need to start a cronjob every day, but an hour later each day. What I have so far works for the most part, except for 1 day of the year: 0 0 * * * sleep $((3600 * (10#$(date +\%j) \% 24))) ...
0
votes
1answer
40 views

What should be the security context of these cron files?

I am running Fedora 20 and I am having some issues when running logrotate and anacron which I suspect may be related to SELinux: Failed to determine timestamp: Cannot assign requested address chgrp: ...
0
votes
1answer
42 views

Restarting process via cron every 12 hours

I'm not familiar with cron at all, and I've looked it up and am still confused as to how specifically it works. I'm on CentOS 6.5, and I need to end a process and then start it again every 12 hours. ...
0
votes
2answers
263 views

Backup of svn repository and mysql database on daily basis

How do I instruct Ubuntu 13.10 server to: zip svn repository dump mysql database into .sql script tar both files copy backup tar onto sdb disk Are there any premade tools for such kind of ...
2
votes
4answers
1k views

Anacron job complains “Gtk-WARNING **: cannot open display”

I'm trying to make a simple weekly Anacron job that backs up my computer if I click yes on the dialog. The script I wrote works fine if run manually, but when Anacron runs it, nothing happens and I ...
1
vote
1answer
87 views

Lock a script starting daemons

I'm run a script with cron: */10 * * * * flock -n /tmp/lock script I have to make sure that only one instance of the script is running at the same time, and for that I'm using flock. The problem is ...
0
votes
2answers
2k views

Sending cron output to email?

I'm trying to send cron output to an email address and am struggling... I'm running the following command: 13 15 * * 1-5 root /path/to/mysql-backup.sh 2>&1 | mail -s "Daily Database Backup ...
1
vote
1answer
62 views

Cannot edit crontab as non root user

When I use the command crontab -e on my Debian server as a non root user (in this case as postgres), I can't edit it because of "/tmp/crontab.SJlY0Y/crontab" [Permission Denied] crontab -l on the ...
0
votes
1answer
140 views

how to set crontab PATH variable

I had a problem running a script from crontab. After some research I understood the problem was because PATH parameter doesn't include /sbin. I looked what it does include in /etc/crontab: ...
0
votes
2answers
35 views

`cron` service and `at` command

Help to understand: is there any relation between cron and at command. Actually if I stop the cron services in SUSE by running following command: /etc/init.d/cron stop after above, if I run at ...
4
votes
2answers
42 views

Create new temporary directory

What's an effective way of creating a new /tmp directory, that behaves just like /tmp (purged on reboot, etc.), but in a different location? In my case, I want to create a ~/dev/tmp directory where I ...
0
votes
2answers
104 views

How to kill a process in shell script which is running through cron?

I have a shell script which runs in cronjob. This shell script has to kill a process which is running and start the new process again. When I run the script manually it works perfectly fine, but when ...
-2
votes
1answer
29 views

Run job at boot and on a schedule from same crontab

I have a process that I need to run on boot and periodically. I've created a file for it in /etc/cron.d/. Is there a way for me to specify that I want @reboot 0,30 * * * *?
4
votes
2answers
254 views

Schedule job at irregular intervals

It's simple enough to use cron to schedule a job to occur periodically. I'd like to have something occur less regularly -- say, run the job, then wait 2 to 12 hours before trying again. (Any ...
1
vote
0answers
28 views

How to find out why my cron didn't run? [duplicate]

This is the content of root's crontab: 0 23 * * 0-4 /usr/sbin/rtcwake -time `date --date="+16 hours" +"%s"` -m mem This is set to fire off that command every Sun-Thu at ...