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

learn more… | top users | synonyms (1)

1
vote
3answers
51 views

script not running as expected when scheduled as a cronjob

I'm trying to write a script that will identify corrupt jpg images using imagemagicks identify command. The script will run the command, grep the output for the word "Corrupt", move it to a corrupt ...
1
vote
1answer
118 views

Boot computer on schedule 2 times per weekday [duplicate]

My setup: I use Ubuntu 14.04 to perform a range of tasks. These tasks are performed whenever I execute a bash script. When it has finished the tasks the computer is automatically shut down (I don't ...
0
votes
0answers
119 views

Issues with a cron script

I have a shell script which does following: Do a scan on websites (URLS coming from all_hosts.txt), Get json reponse which is saved in file (outputscanner.txt) Run a json parser (jq) on above file ...
1
vote
1answer
35 views

handle large number of same log using cron or logrotate

We have an app deployed in a server, which, under some scenarios, generates some logs in the below format. process_name.hostname.common_text.log.{error/info/warning}.date.time Now, due to this ...
1
vote
2answers
43 views

Executing a cron 9 to 5 and at midnight

It's simple for the ones who understand it but for me most of the times it's a big puzzle. I want to execute a PHP script 5 minutes after each hour from 9 to 5 and i want to run it once more 5 ...
1
vote
1answer
35 views

Gnome Schedule cannot run hdparm

I have set up a cron job that should execute hdparm -y /dev/sda >> /var/log/diskspindown.log 2>&1 When testing it running it via "Run selected task" it executes fine and logs /dev/...
1
vote
1answer
29 views

Run certain script periodically at boot time

Suppose the computer is being launched irregularly. And I want to run a certain script at boot time once in a month. But I can't setup a cron job as I don't know whether the machine will be booted at ...
-2
votes
1answer
83 views

Jobs not working in cron, but working manually

I have gone through similar posts in this website, but none of them is matching my query. I have the below content in my crontab, but it is not working. * * * * * perl sc.pl And when i'm trying ...
0
votes
0answers
55 views

cron not running rsync

I'm trying to setup a rsync task using cron. The point is to sync a work folder on a linux partition and its counterpart on a windows partition on a dual-boot computer. To do that, I'm trying to ...
1
vote
1answer
20 views

Correct cron format

So I wanted to execute two commands every every week at beginning of Friday 12am and Sunday night 11:59pm before it turns Monday as I want this to be turned on from friday-sunday night then again next ...
0
votes
1answer
34 views

No indication of attempt to run cron job

I am running the latest Sentora version on an Ubuntu 14 server. I created a cronjob which should run every five minutes but there's no indication of an attempt to run the cron job. I have tried to ...
0
votes
1answer
43 views

Run minecraft from script in cronjob

I tried making this command run at 10:20pm and then the second at 10:21pm but nothing works. I tried as root and as minecraft user but nothing. How can I get it to work? 20 10 * * * screen -S classic ...
2
votes
1answer
122 views

Notify-send doesn't work at Cinnamon

I am using Linux Mint 17. I want to be informed every 50 min, at every hour for small break. Here is cron job: nazar@lelyak-desktop ~ $ crontab -l DISPLAY=:0.0 XAUTHORITY=/home/matrix/.Xauthority ...
0
votes
1answer
85 views

crontab doesn't work corectly [duplicate]

I want to make some notification to user every day at the same time: any_hour:50 And I wrote to crontab -e: 50 * * * * DISPLAY=:0 /usr/bin/notify-send -i /home/nazar/Pictures/icons/...
2
votes
1answer
60 views

How can I get at to work on OSX?

My at on Mac OS X 10.11 seems to be incapable of launching jobs. I tried: echo "date > foo" | at now Running atq afterwards shows the job queued and no file foo was created. To make sure the ...
0
votes
1answer
47 views

Why cron not outputting to file? [duplicate]

I scheduled a cron task: 0 */10 * * * aapa bash /home/aapa/scripts/es_backup.sh &>> /var/log/super/es_backup.log It is running as logged into syslog: Dec 4 08:17:01 dexter CRON[15552]: (...
0
votes
0answers
67 views

How to view processId of process running in WINE

I'm looking to run some Windows Apps on Linux using Wine. However I need a way to check they are running (and haven't crashed). On Windows I use a Powershell script to check the relevant Windows ...
0
votes
0answers
22 views

Rebooting Ubuntu if necessary

My Ubuntu needs sometimes rebooting if it has downloaded upgrades. Can I automate it like do reboot if it is required and there is no unsaved works and I'm sleeping (say for example 3 am)?
0
votes
1answer
104 views

sort and uniq commands not running as expected when run though cron

Below is a part of script which gives proper output when run manually but gives incorrect output when run using cron: sort < file1.out | uniq -ic |sort -nr> file2.out When run on the command ...
1
vote
1answer
51 views

how do i make a script to generate a gpg backup saver?

Im making a little backup script that includes the function to encrypt the backup. The script runs automaticly with a cronjob. So the password for gpg is in a File. Its just a textfile. How can i ...
0
votes
1answer
32 views

How to set Cron job that run after every three hours for indefinite period; with Logging?

I Want to run Cronjob; after every three hours from last run time for indefinite period and can check whether it ran or not Could anyone help me in getting what values to be give in this format: ...
0
votes
3answers
364 views

Crontab on Mac OSX

I have created an /etc/crontab file on a Mac OS X that runs a few simple commands. I would like to use the crontab to echo a statement in my terminal, logout from the OS (as if I was to point my mouse ...
2
votes
1answer
31 views

How to schedule task to run everyday, if I don't know when the pc will be turned on?

So, I could use the crontab command, with: 23 0 * ... but at 23:00 my laptop can be turned off, or hibernated. In that case I want a command to be executed as soon as it will be possible. How can ...
0
votes
1answer
83 views

crontab and selinux

I have Drupal 7 on RHEL 7 and it looks like SELinux blocks crontab. aureport -a showes 90. 11/27/2015 01:32:35 httpd system_u:system_r:httpd_t:s0 87 file unlink system_u:object_r:httpd_log_t:s0 ...
-1
votes
1answer
58 views

Cron does not execute my Python script [closed]

I'm trying without success to execute a Python script using cron on a Debian Jessie Raspberry Pi. I can execute the script manually, but it fails to execute with cron. Here's what crontab -l shows: ...
1
vote
2answers
130 views

Not able to schedule tasks in crontab

[srinkann@sjc-ads-440 ~]$ crontab -e no crontab for srinkann - using an empty one /bin/sh: /usr/bin/vi: No such file or directory crontab: "/usr/bin/vi" exited with status 127 [srinkann@sjc-ads-440 ~]$...
0
votes
1answer
24 views

Script for backup each DB on server but omit system databases

I have read a lot of post around this topic but I didn't found the one to fit my needs. So, basically I want to make two backups: one at mid day (12 PM) and the other at midnight (12 AM) for each ...
1
vote
1answer
153 views

Crontab and Tmux not playing well together

So I want my server to run a script which starts several tmux sessions on boot. This is my crontab: @reboot . /home/steven/.profile; /home/steven/Scripts/Start.sh And this is the content of my ...
1
vote
1answer
45 views

Screen creation not working on crontab

I have a problem with one of my VPSs, in the main one, the command screen -dmS SCREEN_NAME node DIRECTORY (Create a screen without joining it with the command "node DIRECTORY") works normally, in ...
0
votes
1answer
405 views

How to add subject line when sending email output of find using ssmtp

I got a script running (as cronjob) that will list the files in a folder before doing a Rsync job and emailing me the list. How can I add a subject line. find /path/to/folder/ -type f -size +1M -name ...
2
votes
1answer
113 views

How do I run a script every time “yum update” is run?

I'd like to run a script (let's say myScript.sh) every time a yum update or yum install command is executed. So if I run yum update someprogram then myScript.sh should be executed right after that. ...
-1
votes
1answer
230 views

Cron task scheduling and stopping after certain interval [closed]

I am managing a server which has multiple cron tasks, one of the crontab entry is like below: 51 ​*/2 *​ * * /root/backup.sh can anyone explain me what is happening here, at what time the script is ...
2
votes
1answer
39 views

How do I set a script to randomly print to a user's SSH session without setting it up as a Cron job?

I'm managing a small server at work that we use for Samba and SSH. I'd like to mess around with my coworkers by having a script run at random times of the day where it fetches a random quote (...
1
vote
1answer
67 views

Java file is not getting compiled in cron

Can anyone please guide me with this. I run a script file through CRON daily which involves running selenium testcases and sending the report as mail. Here is my script: check.sh #!/bin/sh set -x ./....
0
votes
1answer
62 views

Cronjob to push MongoDB Backup via git

Task: Create a Cronjob that executes a bash script once every night. The bash script should do a mongoDB Backup and push it to a Git Repo. So I created a cronjob as the root user via the crontab -e ...
0
votes
1answer
137 views

a cron job to delete a specific file once it reaches more then 1gb size?

My server broke down with exenstive damages when a log file reached 27 gigs in a few hours. Log files are compressed daily, and are usually very small, maybe up to 10mb in 24 hours. Today there was an ...
1
vote
0answers
140 views

Problem using crontab playing beep sound

I'm trying to create something like a watch does. The beep sound indicating that an hour has been passed. So I opened the crontab(sudo crontab -e) and wrote this line(there are five asterisks just ...
0
votes
1answer
51 views

Running crons on a scaled mirrored servers (cron logic needed) [closed]

I have a client running on Rackspace, they have three servers that are synced together entirely, I've added a bunch of crons in the crontab using wget to the web address of the cron (that sync to each ...
1
vote
1answer
54 views

How to add change directory and git pull to this crontab line?

I have this directory structure: /var/sync/ ├── sync_bi ├── sync_pfizer └── sync_sandbox I have a few files running by the following cronjob: 10 */12 * * * find /var/sync/ -name 'Replicator.php' -...
1
vote
2answers
87 views

Script usually works, but not with cron

I have a script that looks like this: #!/bin/bash D=~/brew\ update num=$(ls "$D" | cut -d ' ' -f 2 | sort -nr | head -1) num=$(( num + 1 )) script -q "$D/brew_update $num" brew update This ...
0
votes
1answer
56 views

cron doesn't do anything

I tried making some crontabs, I created a file called brewupdater in my user folder, containing 0 */5 * * * ~/bin/brewupdate2. I then tried to run cron ~/brewupdater but it told me: cron: can't open ...
0
votes
1answer
20 views

Cleaning script with find and anacron

I want to automatically delete old files in ~/Downloads. with exception of ones that have '!' in their name. My current version is as follows: find /home/user/Downloads/ -mtime +90 ! -path '*!*' -...
8
votes
3answers
2k views

Run multiple cron jobs where one job takes a long time

I have the following general question regarding cron jobs. Suppose I have the following in my crontab: * 10 * * * * someScript.sh * 11 * * * * someScript2.sh 30 11 */2 * * someScript3.sh <-- ...
0
votes
1answer
46 views

Cronjob not being executed

I'm trying to run rsync-books with a crontab. Typing crontab -e outputs: 55 12 * * * diegoaguilar /storage/bin/rsync-books Where /storage/bin/rsync-books looks like this: if [ -d "/media/Beagle/...
1
vote
1answer
370 views

How to programmatically add new crontab file without replacing previous one

I am working on a small home automation project using raspberry pi (OS -Raspbian). I want to know how to add more than one crontab file using python-crontab module without replacing the previous ...
0
votes
2answers
911 views

Centos7 - crontab not running

I want to write a crontab that opens a firefox every minute (just to test it, i know it doesn't make any sense) My problem is that even though crontab is active nothing happens. This is how my crontab ...
0
votes
1answer
47 views

output logs in crontab does not work [closed]

I have a cron job it's on runnable .jar but I really want to check the output logs in console. but I wondered also if this command below will start to run on 3:15am but this jar takes time a lot of ...
1
vote
1answer
449 views

crontab -e yields: /var/spool/cron/: mkstemp: Permission denied

I'm trying to set up a cron job under my user. I run crontab -e, make my edits, and try to save and exit. I receive the following error message /var/spool/cron/: mkstemp: Permission denied. Relevant ...
1
vote
0answers
44 views

Change events order in bash script that writes to crontab

Coming from the solution on this post I have made a few changes to the original script but output is not like it should be. Below is the script as I have right now: #!/bin/bash add=$1 php=/usr/bin/...
2
votes
3answers
185 views

Read each directory and perform actions in Bash script

I have this directory structure at /var/sync: # tree -d /var/sync/ /var/sync/ ├── sync_bi │   ├── replicator => Replicator.php │ sync.php ├── sync_pfizer │   ├── replicator => Replicator.php ...