Questions tagged [cron]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
21 views

Making appointments in Calcurse without using interactive CLI interface

I'd like to make a automated script so I could enter some repeating events in Calcurse. Is there a way to do this without using the interactive interface?
2
votes
4answers
726 views

About executing a python program in a shell script which is scheduled on crontab

I have a problem with regards to crontab. I have a script named checker.sh and I want to schedule it so that would run every minute: * * * * * sh /home/pi/checker.sh I have the script here: The ...
12
votes
4answers
39k views

cronjob for automatic DB backup to date prefixed file

I am using the latest Linux Mint. I was wondering if it's possible to create a special cronjob for a database backup. In my /etc/cronjob file I have the following code: # Minute Hour Day of ...
1
vote
1answer
4k views

auto restart Apache when high load average

My server always shut down when it reach a high load average. I have optimized my Apache, MySQL. But I cannot prevent sometime in a heavy traffic. So I try to write some shell to control load average. ...
3
votes
1answer
159 views

How to one way sync two folders on startup

I am trying to synchronize: /var/www/CI_MAIN/ according to the changes made in: /home/coco/workspace/CI_MAIN/ (PDT's workspace). To do this, I entered sudo crontab -e in the command line, ...
0
votes
1answer
58 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 ...
2
votes
2answers
5k views

How to use exit status in crontab

I add the following script line to the red-hat crontab, script should run on Saturday in 5:00 in the morning. In order to run the script /var/scripts/PLW.pl every Saturday at 05:00 morning. I want to ...
8
votes
3answers
888 views

Echoing a tail command produces unexpected output?

This command, when run alone, produces the expected result (the last line of the crontab): tail -n 1 /etc/crontab However, when I run it as part of an echo command to send the result to a file, it ...
1
vote
1answer
43 views

Having trouble with cron

I have an Intel NUC with Ubuntu installed. It runs a Minecraft server. I wanted a simple backup system for the server, and through some Googling I found that I can do so using cron and tar. However, I ...
0
votes
2answers
115 views

What should I do to run a script on specific time without cron?

I want to run a script without using cron at specific time. But it is not working. #!/bin/sh DATE=`date | cut -d' ' -f4` #Date is getting printed, if I run it manually, without any error. But file ...
0
votes
0answers
17 views

CRON running job not in my user's crontab file

You read that right. It's the opposite of everyone's issue. I'm on a Pi 3 w/ Raspian I have a cronjob that is running once when it is supposed to (9am, 0 9 * * *) and is running rogue again at 5:...
0
votes
2answers
30 views

Cron task won't run, although all is correctly set up

This cron tqsk doesn't work: [main_usr@localhost ~]$ sudo crontab -l -u root 0 * * * * /home/main_usr/cron_test1.sh > /home/main_usr/cron_test1_out.sh.out 2>&1 [main_usr@localhost ~]$ ...
1
vote
1answer
165 views

How to automatically start Rescuetime on startup (tried crontab and rc.local)

I have installed rescuetime on debian 9. It requires the command rescuetime to be run in a terminal, this just keeps running rather than running and closing (it adds an icon into the tray at the ...
-1
votes
1answer
60 views

How to make secure backup in Ubuntu Linux

I tried to understand the code but I have some difficulties in it. crontab -e is crontab schedule formatpm 9pm at night every Sunday, but it seem to me it is encrypted.  Can any one explain it? ...
0
votes
0answers
38 views

Run and close a file every few minutes

I need to play an audio file and after 3 minutes close it, then all over again. play it 3 minutes and close it. Currently I'm using a cron job to open the file in VLC and close it, but it's not good ...
0
votes
0answers
20 views

crontab daily backup [duplicate]

I want to use following command to back up my crontab on daily basis: crontab -l >/var/BackUpSource/crontab/crontab-$(date +%Y-%m-%d_%H:%M) It works perfectly in console. But when I try to set it ...
0
votes
1answer
2k views

cron job to run under conda virtual environment

I have a Anaconda Python Virtual Environment set up and if I run my project while that virutal environment is activated everything runs great. But I have a cronjob configured to run it every hour. I ...
10
votes
2answers
24k views

System Crontab or Root Crontab

System crontab: /etc/crontab Root crontab: sudo crontab -u root -e Which way is preferred? As they all run tasks within administration privilege.
1
vote
1answer
921 views

CentOS machine keeps “losing” active directory membership

All of our CentOS 6 machines have been joined to our active directory domain. Each of these machines eventually "loses" their domain membership, which breaks authentication for AD users. I created a ...
0
votes
2answers
260 views

Local variables in Bash script to be run by Cron

I have a bash script which loops through a list of filenames in a text file, deduces a date from the filename and then calls a library script (./dropbox_uploader.sh delete [filname]) to conditionally ...
1
vote
1answer
2k views

Cronjob is running every minute but not at a specific time

The job works if set like this: */1 * * * * /usr/bin/php /home/test/cron/test.php And if set to something like: 15 20 * * * /usr/bin/php /home/test/cron/test.php it's not working. [root@localhost ...
19
votes
3answers
20k views

Crontab entry with hour range going over midnight

Is this valid crontab time specification, doing what is expected: 0 22-4 * * * Or is it necessary to do something like 0 22,23,0,1,2,3,4 * * *
1
vote
6answers
205 views

Trigger an action when an URL has been visited

Let's say I send an email, containing a link to my website, to someone that I really hope he'll visit it (fingers-crossed style): http://www.example.com/?utm_source=email392 or http://www.example....
30
votes
12answers
19k views

Using notify-send with cron

I am using Arch Linux with KDE/Awesome WM. I am trying to get notify-send to work with cron. I have tried setting DISPLAY/XAUTHORITY variables, and running notify-send with "sudo -u", all without ...
1
vote
1answer
2k views

Trying to create a cron to Rsync then tar the folder

I'm stuck at the first hurdle! I want to run a couple of commands from a bash script. First something like this to rsync some directories: rsync -e ssh -az user-whatever@website.com:/home /location/...
0
votes
1answer
145 views

How to check the version of cron that is running?

how can I check which version of Cron is currently installed and running on my host? I can't seem to find a command that will allow to me see which version is running. They all seem to just show ...
0
votes
2answers
75 views

Allow null password for file transfer from Sunsolaris machine to linux mchine?

I m trying to pull a file from a Solaris server to my Linux server and I did it successfully by using scp.I want to run this below command as a cronjob, How can I save password for this automation ...
10
votes
5answers
6k views

nginx logrotate error on cron job

I'm running Ubuntu 14.04 LTS and nginx on a Digital Ocean VPS and occasionally receive these emails about a failed cron job: Subject Cron test -x /usr/sbin/anacron || ( cd / && run-parts -...
0
votes
1answer
56 views

crontab(1), crontab(5) what's the difference? [duplicate]

I want to learn how to use crontab. I see there are two manual pages: crontab(1) crontab(5) Why are there 2 manual pages? What are the differences between them? Do I need to study both in order to ...
0
votes
2answers
63 views

Cron log shows shell script has run but it really hasn't

I'm trying to setup a relatively short shell script called backup_extract.sh which will essentially unzip a zip file, drop a database, create a database of the same name, then import an sql file that ...
0
votes
1answer
72 views

How can I open a shell in the environment that cron (alternatively launchd) uses to execute commands?

I am trying to get launchd (which is macOS's alternative for cron) to run a job for me. It doesn't work, while running the commands on a bash launched with sudo does. I tried redirecting the output to ...
1
vote
0answers
87 views

install job on crontab

I definitely sure that the syntax I am using in the crontab file is correct because I installed the same job on another host and it is working fine. The syntax is: 05 10 * * mon,wed,fri /app/aban/...
0
votes
1answer
51 views

X11 and pygame in Crontab

I have a script very similar to the one at the end of the pygame example page, and I want to run it on startup to make the whole thing listen for commands on startup. I ran "crontab -e" and as a first ...
0
votes
0answers
21 views

It seems that my cron task doesn't run [duplicate]

I have cron task for root that should run daily: $ whoami main_usr $ sudo crontab -l -u root 0 23 * * * certbot renew --cert-name app.my_domain123.com --pre-hook "systemctl nginx stop" --post-hook ...
0
votes
2answers
1k views

Netcat as Daemon

I'm trying to set up something that telnets into a device and saves the output to file. I can get it working on the CLI, but not running it at boot (using crontab) This works running running on the ...
1
vote
1answer
49 views

Modify subject line of cronjob

I have the following one-line cron command set up which gives me a nice simple message in the body of the email upon backup complete (thanks to @steeldriver). tar -cpzf /home/user/backups/...
0
votes
1answer
32 views

Add log filename with minus 3 day in crontab

I want to set my log file name into crontab with date - day, not current_date. I've already success for current date like this: 00 02 * * * bash run_myscript.sh > /logs_myscript_`date "+\%Y\%m\%d"...
0
votes
1answer
341 views

“sudo shutdown now” in my crontab @reboot

Now whenever my EC2 instance starts, it shuts down immediately, anyway to salvage this situation? OS: Ubuntu18.04
1
vote
2answers
358 views

Schedule python script every day, between certain hours, every X minutes

I have a python script on my RaspberryPi that I want to run at these general times: Weekdays, after 4:30 PM until 00:00 running every 30 minutes Weekends, after 8:00 AM until 00:00, running every 60 ...
0
votes
1answer
5k views

Crontab in docker container

Hi I'm trying to run a cron job in a docker container. So I have added that in my Dockerfile My Dockerfile FROM nginx:stable RUN apt-get update -y && apt-get upgrade -y && apt-get ...
3
votes
1answer
836 views

When are “cron.monthly” cron jobs run?

I want to run yum updates on a monthly basis which is actually running daily now. Can I move 0yum-cron from cron.daily to cron.monthly? If yes, then how can we know which time and day of the month ...
0
votes
2answers
113 views

Monitor process pid for change

I have a service that is always supposed to be running. I’d like to know when the service ever stops or gets restarted. I’ve thought about referencing the service’s PID. If it gets restarted, it ...
1
vote
1answer
76 views

Why does this script output corrupt files when run automatically with crontab?

I have a script that scans a folder for all .mp3 files and creates an index. Next it waits 5s otherwise it doesn't work correctly. Lastly, it removes bad characters from the song names. I have this ...
3
votes
1answer
1k views

Can I move 0yum-cron from cron.daily to monthly?

I installed the yum-cron package, configured too only check for updates and then mail me. But, doing this daily, seems a bit too much. I would like to do this monthly. The file is located in /etc/...
4
votes
0answers
114 views

rsync gets stuck on *.png files [closed]

I have been running the following rsync command as a cronjob for the past month. Today I discovered that this has been getting stuck on a *.png file and none of my other data has been backing up! In ...
0
votes
1answer
26 views

How to chedule a (long term) cron-task on a desktop?

Every crontab command require as mandatory the minute, hour and day fields. Now supposing I just want that a certain script or command should be executed once every 3 months on my desktop. AFAIK ...
0
votes
2answers
34 views

How to limit the email output from a Cron Job

I have setup a cron job from cpanel to email me daily so I know the site files have been backed up. However, it emails the entire file paths and the whole job. Snippet of the email output I receive; ...
0
votes
0answers
17 views

the command don't run in crontab [duplicate]

hi I have problem with runnig this command in crontab mysqldump --defaults-extra-file=/var/www/xxxx/backup/database/.sqlpwd dbName > /var/www/xxxx/backup/database/database-dump-"$(date '+%F').sql"...
2
votes
2answers
2k views

CRON Job To Execute Command On Low Memory

I have a situation where I may need to execute an SAP command line tool hdbsql when memory gets too low (to help clean out the HANA table cache). How I can best approach this? I did have an idea to ...
7
votes
2answers
9k views

Can I automate tar's multi-volume-feature?

Ok, so I've just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a quite nice multi-volume feature, although when I try it ...