Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cron]

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

1
vote
0answers
22 views

Redirecting input from cron job

I'm using a plugin manager for vim (vim-plug), and have a cron job to perform updates: vim +PlugUpgrade +qall &>/dev/null; vim +PlugUpdate +qall &>/dev/null This job occasionally ...
2
votes
0answers
30 views

How to deny crontab to group

I'm trying to deny crontab to group but I had no success so far. Nor I saw how to do it, or even discussions about it. Is it possible to deny crontab to groups instead of users? Imagine if you have ...
0
votes
0answers
8 views

Cron and etherwake on Raspbian

I wrote small app which runs etherwake. From bash it works fine and wakes up another PC. But if it is launched from crontab, then nothing happens. Has anyone encountered a similar problem and how to ...
1
vote
0answers
58 views

Why does this rsync command running in a cron fail?

Why does this rsync command running in a cron fail and how to debug it and fix? unset SSH_AUTH_SOCK && unset KRB5CCNAME && rsync -hvru -e "ssh -p 34503 -i /root/.ssh/...
0
votes
0answers
13 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?
7
votes
3answers
837 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 ...
0
votes
2answers
55 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
16 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
votes
1answer
40 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
37 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
19 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
40 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 ...
1
vote
0answers
37 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
2answers
40 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
31 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
17 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
0answers
25 views

Is it possible to set at or cron job at logon event? [duplicate]

Is it possible to write an at or cron job script that will execute on a particular user's logon? If so, what will be the method?
0
votes
1answer
54 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
0
votes
1answer
20 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"...
3
votes
1answer
620 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 ...
1
vote
2answers
78 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 ...
1
vote
1answer
56 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 ...
0
votes
2answers
55 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
36 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
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
25 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"...
-6
votes
1answer
33 views

How can I run a job every 2 minutes through crontab in Linux? [duplicate]

How can I run a job every 2 minutes through crontab in Linux?
0
votes
0answers
23 views

Running a BASH script via crontab causes ecryptfs volume to unmount

On my MX-18 linux (Debian 9 Stretch based) system, whenever a script runs via cron, my Private ecryptfs volume unmounts. Confirmed, no issue running the same BASH scripts from a terminal. Tested with ...
0
votes
2answers
19 views

Overwrite file with stdoutput from cron execution

I have this cron in my crontab 00 01 * * * /srv/python/proj/acquisizione/acquisizioneAOK.sh >> /home/crontab_logs/acquisizioneAOK.out 2>&1; mailx -s "Cron output: acquisizioneAOK" ...
0
votes
2answers
38 views

Replace log file without affecting “Redirection of stdin and stdout” using nohup

production.log [2019-02-11 10:18:18] GET / [2019-02-11 11:18:19] POST blavadasdasdgd ... ... <--- A lot of in between logs and other data ... [2019-02-12 11:18:20] INFO ::HTTPServer#start: pid=...
0
votes
0answers
16 views

Question regarding sudo & crontab

I just created a script that is being run as a @reboot item in crontab -e. It runs two scripts...in order. One creates ramdisks and populates them, and another runs an executable that depends on ...
1
vote
1answer
57 views

Starting batch jobs at exact time slightly before the new hour starts

I've been reading the recent blogpost "Winding down my Debian involvement" by Michael Stapelberg. Sad details aside, it's been mentioned that within Debian infrastructure batch jobs run four times a ...
0
votes
0answers
41 views

Ubuntu 16.04.5 Ruining Monitors By Never Turning Them Off

I've seen, on two occasions, where Ubuntu 16.04.5 has completely ruined laptop monitors by never turning them off. These were laptops my Uncle owned, where he left them on all the time. I'm now ...
10
votes
2answers
911 views

Why does cron require MTA for logging?

Why does cron require MTA for logging? Is there any particular advantage to this? Why can't it create a log file like most other utilities?
0
votes
0answers
28 views

running bash script from cron job not working properly

I have the following script: #!/bin/bash echo "$(date +"%r")" if [ "$FOLDER_ID" != "0" ] then node /sync.js -d $FOLDER_ID -l /Downloads fi I'm using docker container and I have passed the env ...
0
votes
0answers
9 views

failed rsnapshot of mapped network directory when scheduled

I have a problem when running rsnapshot for backing up a network mapped drive directory to my local client via cron (and only via a scheduled job). If I run rsnapshot in a CYGWIN terminal manually I ...
0
votes
1answer
33 views

How to get a shell script to execute correctly on reboot

I have a shell script that gets updates from github and then runs the code that it retrieved. it is located at /home/me/Desktop/refreshCode.sh -- refreshCode.sh -- #!/bin/bash cd /home/me/src/...
0
votes
0answers
17 views

Crontab (Replaced) on Logs - explanation

I've noticed that one of my scripts aren't running and found that it is on last Feb 21. Checked it on the cron logs and found this one: Feb 21 16:07:21 callertag-cc01 crontab[18564]: (ctapp) REPLACE ...
0
votes
1answer
26 views

unable to execute git pull if the script is executed on reboot

I have created the following script: #!/bin/bash cd /home/pi/workspace/my-app /usr/bin/git pull python3 main.py & If I run the script from the console, git pull is executed as expected and then ...
0
votes
1answer
34 views

Cron email not sent by sSMTP if job takes > 5 minutes

We have two servers, one of which runs Ubuntu and the other Amazon Linux 2. Both run a series of cron jobs for different clients. The Ubuntu server sends an email (to a group email address) with the ...
1
vote
1answer
35 views

/bin/crontab and /usr/sbin/cron in cygwin - what is the difference?

I have just installed Cygwin on my Win Server 2008. I have a bash backup script (to backup some user files to an external harddrive) that I want to run on the machine, under crontab, every night. I ...
0
votes
0answers
33 views

How do I get CRON to run a script that works in my regular shell, but not in CRON? [duplicate]

I am running Ubuntu 18.04 LTS on an Amazon LightSail instance. When I try to run a Python script as soon as I log, it runs perfectly. I run my script with the full path in with the command: /usr/bin/...
0
votes
1answer
44 views

Verify cron daemon is enabled in Slackware 14.2

How will I know if cron daemon is running in my Slackware installation? I tried the code below and it returns me nothing. It means cron is not in /etc/rc.d folder. ls /etc/rc*.d | grep crond
0
votes
3answers
85 views

How to insert a line into a crontab AFTER a key word or string via script

I understand there is a lot of documentation on editing crontabs via script, and I can do this by adding an entry with the following command: line="* * * * * /my/folder/script.sh" ( crontab -l ; echo ...
0
votes
1answer
23 views

how to to put a shell script in crontab in solaris to automate the script [closed]

#!/bin/bash # Checks rather system is running Linux or Solaris function osCheck { os_type=$(uname -i) echo "Checking OS type." case ${os_type} in "x86_64") ...
0
votes
2answers
34 views

Syslog Output File Splitting HOURLY at Syslog Server

I have implemented syslog server on CentOS and using below Template to generate output file on daily basis - $template TmplNationalIP_PL, "/var/log/NIPFW/MX480/CGNAT_PL_%$year%.%$month%.%$day%" if ($...
2
votes
2answers
107 views

Slackware 14.2 - /etc/crontab does not exist

When I go to /var/log/packages/ , I can see there that I have already installed dcron-4.5-x86_64-5, which I believe is the same as crond. Now, I want to ensure that permissions on /etc/crontab are ...
0
votes
3answers
51 views

Unable to get out from crontab command

I am using a fresh installation of Ubuntu 16.04 LTS. Whenever I type: sudo crontab -e OR sudo -u www-data crontab -e The command prints some number and nothing else. And whatever you do to try to ...