cron is a task scheduler based on clock time that runs on Linux-based machines.

learn more… | top users | synonyms

0
votes
1answer
17 views

logrotate files older than x hours

What's wrong with this rotate.conf? Goal is to delete only files older than four hours path/to/tokens/*.tkn { nosharedscripts prerotate if test `stat --format=%Y $1` -le $(( `date +%s`...
0
votes
0answers
10 views

grab file every x min, and save with continuous number

I have a ip camera which saves pics to my rasperry pi's ftp, than the pi uses imagemagick to overlay some text and saves it as webcam.jpg this happens every x minutes via cron now i want to grab the ...
60
votes
7answers
133k views

Run a command every week with Cron?

Simple question- what would a crontab entry look like for a command I want to run every week on Saturday at 8:05 AM?
0
votes
0answers
8 views

somehow after rtcwake command runs, the system time seems to change

I use fedora 21 for home server, and I installed rtcwake command with cron to save electricity to put it to sleep most of the time. For about a week, it seemed to work fine waking up after ...
0
votes
0answers
9 views

Making fcron run all jobs in a manually given time range?

How do I tell fcron, to run all jobs scheduled for a time range that I’d give as a parameter. My PC might be off in the scheduled time, e.g. because I slept at an unusual time. And I can’t run them ...
2
votes
7answers
9k views

Automatically restart a Unix job if it goes down?

I have a job that I would like to "daemonize" on Unix: I want it to come up when the computer boots, and I want it to restart if it goes down. A simple way to do this is to setup a cronjob that runs ...
0
votes
0answers
32 views

I have an issue with the cron

I have this script : #!/bin/bash if [ ! -e /home/mam/restart.lock ]; then touch /home/mam/restart.lock killall arma3server /home/mam/arma3server & fi I made a cron like that : * * ...
0
votes
0answers
33 views

Detect failing USB hard drive automatically

I Have a Raspberry Pi which has one USB external hard drive attached to it (via a separatly powered USB hub). The thing is that sometimes this disk becomes unresponsive (I can't access its mounted ...
4
votes
2answers
4k views

Linux startup script to connect to bluetooth and cron to keep it connected

I have a mini Bluetooth keyboard and a Raspberry Pi running a Debian-based distro. I know the MAC address of the keyboard but for this question, let’s just use AA:BB:CC:DD:EE:FF. Right now I have to ...
2
votes
3answers
1k views

Logrotate Error

When using logrotate from a cronjob, I am getting this erros: error: unable to open /var/log/mylog.1 for compression Does any one know what does it mean and how can I fix it ?
1
vote
2answers
24 views

unexpected EOF while looking for matching `"' for cron job

I am fighting with a cronjob which does not work. Everytime when it is executed it get an error-mail saying /bin/sh: -c: line 0: unexpected EOF while looking for matching `"' /bin/sh: -c: line 1: ...
0
votes
0answers
3 views

Install cronjob from file to a specific user

I have an install script that sets up a user. Using the install script, I want to apply a cronjob that gets executed by that user (myuser): 0 4 * * * /home/myuser/script-to-run-at-4am.sh I have ...
0
votes
0answers
32 views

Schedule on crontab to reboot router

I would like your much aprreciated help. I have a ISP router (gateway) that doesen't have a schedule reboot on the web interface. I have a raspbian and I would like to schedule on crontab to reboot ...
0
votes
1answer
44 views

php script runs from the browser but not from cron job

I am using Centos 7 as my webserver. When I run script.php from the browser, it works fine and processes all the data in the MySQL table. When I run it using a cron job, it runs forever but will not ...
2
votes
1answer
313 views

Cron Command for twice a month on Sat @12am

I am wondering if someone can help with the simple but sometimes confusing commands regarding Cron jobs. I would like a cron job to run twice a month on a Saturdat @12am.
1
vote
3answers
157 views

Executing PHP from crontab

I am utilizing crontab to execute a PHP file as follows: 0 4 * * * /opt/lampstack/php/bin/php /opt/lampstack/apache2/htdocs/tests/test.php I am pretty sure that the file itself is working properly ...
1
vote
1answer
36 views

How to find the user who is running rsync?

In Linux, if rsync is already running, how can we identify which user is running it? And what if it is running as cron job, will the cron job user be different?
0
votes
2answers
48 views

How to use crontab to launch scripts

I have created a script (which I already tested if it works) and I want to use crontab to launch it everytime my pc reboots. I created these script called test.sh just for fun and it's pretty easy: ...
1
vote
1answer
36 views

How to allow multiple users to access to the same crontab in Debian Linux v8.4?

I am trying to create a crontab for a group of users, lets call the group "testGroup". There are 3 users, and I want to give all of them access to the same crontab. I did some research and tried to ...
0
votes
1answer
21 views

Where to save scripts on DD-WRT power-less-safe?

i have saved script into /tmp folder but when router lost power, file was deleted. Is there any safer variant to save? I need to run this script every minute by cron.
3
votes
2answers
99 views

How to start a screen session from a shell script using crontab and then reattach to it?

I want to run the following shell script (launch.sh) to start/stop a screen session using crontab !/bin/bash cd ~/screen DATE_FORMAT=+%Y-%m-%d:%H:%M:%S echo --- START --- date $DATE_FORMAT if [ -...
1
vote
3answers
742 views

cron table mailx caused empty content

I'm using centos 7.0/6.5. The content of /etc/cron.hourly/mail.cron #!/bin/sh log=/var/log/mail.cron.log echo "`hostname` `date`" >> $log 2>&1 mailx -s "test mail" me@example.com < $...
0
votes
0answers
27 views

How to fix report timestamps generated by aureport via cron?

I set up two aureport cron jobs the other day: 1 0 * * * /sbin/aureport -ts yesterday 00:00:00 | mailx -r "info@domain.com" -s "[Audit report] Summary" "user@domain.com" 1 0 * * * /sbin/aureport --...
1
vote
2answers
52 views

Cronjob not running script

I've created a script to get my external IP address, check if it's changed and if it has, email it to me letting me know. Here's the script, aptly named ip.sh (server hostname is "odin"): #!/bin/sh ...
1
vote
0answers
37 views

How can OS X cron use existing ssh-agent without environment?

I've looked all over these forums, and either haven't found an answer to this, or more frequently, the question is different. Client is OS X El Capitan. I am logged in, and my ssh key (with ...
0
votes
2answers
107 views

Can't start a job with Cron on Ubuntu startup

I am trying to get a simple Python script running on startup with Cron on Ubuntu 16.04. What I did is opened cron with: sudo crontab -e and added the last line as shown in the screenshot: Then I ...
1
vote
0answers
45 views

How to get statistics of CPU throttling?

My dmesg output says that the CPUs are throttled, because of the temperature. [ 1283.260276] CPU3: Core temperature above threshold, cpu clock throttled (total events = 1) [ 1283.260277] CPU2: Core ...
0
votes
0answers
30 views

Full text, dynamic, RSS feed generator

I am looking for a solution to produce and update regularly full-text RSS feed. The goal is to provide full text feeds from a variety of websites to my canto rss reader. There are several services ...
0
votes
1answer
127 views

How can logrotate execution result in “service: not found”?

I am trying to understand the output of my logrotate script execution: error: error running shared postrotate script for '/var/log/nginx/*.log ' logrotate_script: 2: logrotate_script: service: not ...
0
votes
1answer
33 views

How to fix connection loss in VM?

My virtual machine loses the internet connection sometimes on linux and I need to stay connected constantly. So I wrote the following script: #!/bin/bash wget -q --tries=10 --timeout=20 --spider ...
0
votes
1answer
37 views

how to see the output of a cron/at jobs while it is still running?

The output of a cron or atq job is automatically send by email to the user, when the job is finished. However I am running a time consuming script, and I would like to check that it is running ...
1
vote
1answer
87 views

Anacron fails to open folder cron.daily / cron.weekly

Recently I switched from user-specific anacrontab ( using -t ) to the global-one. Now each day anacron drops me a message (email to root) that it failed to open the cron.daily folder: Subject: ...
3
votes
3answers
56 views

sudo via cron'ed ssh works in RHEL6 but not in RHE7 (/dev/tty: No such device or address)

I give up: I have a cronjob script that Ive been running for years (out of a RHEL 6.7 machine) to remote into other RHEL machines via ssh. Works flawlessly against RHEL5 and 6 but fails against ...
0
votes
0answers
46 views

How to make automatic hourly/daily/weekly snapshots with Btrfs

I remember working at a company with a NetApp server in 2003, and we had a snapshot directory in our home directories, with various snapshots appearing in it. I think there were snapshots for the last ...
1
vote
5answers
7k views

Disable cron jobs for a specific user

I have a list of jobs in the crontabs for user1, user2. I want to prevent the jobs of user2 from running. I tried listing user2 in cron.deny, but that only prevents him from accessing his crontab. ...
0
votes
0answers
51 views

aws linuxAMI crontab ec2 to s3 backup command not working

I am new to Aws Platform and was trying to get Hands on experience on Command Line... but when i was configuring installed wordpress site...and syncing it to S3 bucket.. and for that my instructor was ...
0
votes
0answers
18 views

Cron job appears to work, but no changes seen in file

I have a simple cronjob that uses curl to download a file and save the contents to a file. The crontab file reads: 45 17 * * * /home/my_username/public_html/./update_md.sh where update_sh.md = #!...
0
votes
0answers
16 views

Schedule the cPanel Transfer Tool

I'd like to schedule the transfer tool from cPanel, i'd like to do this daily to keep things synced with a failover backup server, identical to the first. I am looking at https://documentation.cpanel....
1
vote
1answer
36 views

Debian - How to get notified when packages for “dist-upgrade” are available?

I automated apt-get update && apt-get upgrade by using the package unattended-upgrades together with anacron. It makes sense that unattended-upgrades does not execute apt-get dist-upgrade, ...
0
votes
2answers
104 views

Problems with Autossh: running from cron vs terminal

I'm trying to setup a reliable reverse tunnel between a server to several client boxes. I'm using autossh to re-establish connections if they drop or go stale but I'm having some problems. THE SERVER:...
0
votes
0answers
131 views

cron apparently requires a newline character on its own line at the end of the file

I'm trying to understand why cron is refusing to work with a certain crontab file. The manpage for crontab says: cron requires that each entry in a crontab end in a newline character. If the ...
0
votes
0answers
17 views

cron expression day of month AND day of week, instead of OR?

Probably not, but is there any way to make DOM and DOW in a cron expression be an AND relationship? For example: "0 0 1-7 * thu" Means: At 00:00 on the 1, 2, 3, 4, 5, 6 and 7th of every month and ...
1
vote
1answer
24 views

Cron Job Update

I have two files under /etc/cron.d/ named j1 and j2. I make changes to those files, and in a little file the changes are gone and I don't seem to figure out who/what reverts the changes. Is there a ...
41
votes
8answers
70k views
0
votes
1answer
526 views

How can I make cron to email report audit only if there is something to report?

I setup daily cron job checking if files have changed previous day, since those files are not suppose to changed i'm getting empty report, how can i change it to send email prevent this. this is my ...
1
vote
1answer
114 views

script executing perfectly in terminal but not in cron

I setup a script for to take an mysql db backup everyday on a specific time, so now the cron is running perfectly it executing the script without problem but the problem is db backup file is not ...
0
votes
2answers
20 views

KShell script skips commands when scheduled in cron

I have a Kshell script which executes a java program. /path/to/java -jar jarfile.jar some parameters > log Same line 5 times with different parameters appending output to log file. cat log | mail -...
0
votes
0answers
55 views

Can't open URL on remote display from cli over SSH

So I'm running an office 'dashboard' on a Raspberry Pi (wheezy) in my office. I've set up the pi to kiosk mode that automatically loads up the scrolling graphs page on boot. All day long it loops a ...
0
votes
0answers
42 views

How do you commit changes to an XML file to source control when they are changed by the users of a web app?

An admin web app (closed-source, 3rd party) that we use generates XML files into the Linux server where it is running. These XML files contain application settings for a production application. Only ...
0
votes
1answer
83 views

Can't use /usr/bin/security to retrieve password from keychain via cron

I can't seem to be able to successfully retrieve passwords from keychain using /usr/bin/security when I run it from my users crontab. Works fine in my terminal. I can also see via the cron mail ...