Stack Exchange Network

Stack Exchange network consists of 174 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 time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates.

0
votes
0answers
7 views

Incrond | Use $HOSTNAME environmental variable

I'm using Incrond to check a folder for file changes which triggers a Rsync job to our storage server. This configuration is deployed through Puppet, and therefore would like to use the $HOSTNAME ...
2
votes
1answer
44 views

How can I stop a systemd service with cron?

I have a simple crontab entry that is supposed to stop a service, yet it does not work. * * * * * systemctl stop nginx I even tried: * * * * * /bin/systemctl stop nginx Since that't the location ...
0
votes
2answers
23 views

How does yum-cron send emails from localhost?

I have an amazon linux 2 server running in the aws cloud and I have yum-cron running on it. I have an email domain mydomain.com which is running on a separate server in a completely different cloud ...
0
votes
0answers
33 views

Using crontab to run screen on boot [closed]

I want to run this command on boot on ubuntu server 18.04: java -Xmx1024M -Xms1024M -jar ~/minecraft/server.jar nogui I also want to run it on the screen. So I typed crontab -e and put this line of ...
1
vote
0answers
22 views

Multi VPS: Best practice for semi-automated upgrades?

I've got many virtual private servers, each needing some apt-get upgrade -y lovin' from time to time. (Ubuntu 18.04) Problems I face: I don't have time to upgrade each one manually. I don't want to ...
0
votes
0answers
18 views

Debian Error opening terminal: unknown

I'm trying to edit my crontab for website, using debian on webserver Command Shell(I'm new with this), I try to use this command: crontab -e -u www-data but I get this : no crontab for www-data - ...
0
votes
1answer
51 views

/var/log/cron.log returning CRON[PID]: Permission denied for domain joined account

I'm trying to get a cron job to run, but not as root. Within the context of the user (domainuser@contoso.com), here are the outputs of the crontab and cron.log: Output of crontab -l # Edit this ...
-1
votes
1answer
21 views

crond service running after removing the entry in crontab

I removed the entries in crontab for root and still, I can see the scripts running tail -f /var/log/cron. How can I remove those entries. Output of cron log: CROND[2736]: (root) CMD (/home/centos/...
0
votes
1answer
49 views

Configuring Linux server for long term use (no remote access granted after deployment)

Not sure if the title is the best but to explain a bit more: I have to deploy a Linux box on a customer network that I will not have remote or regular access to. I want to ensure that the system ...
1
vote
0answers
13 views

Crontab not working for pageres, showing error MTA installed, discarding output [duplicate]

my ubuntu machine has pagers for taking screenshots, it is working when I run manually root@bobby:~# pageres https://example.com 480x320 --format=jpg --filename 'page' --overwrite But, when I enable ...
1
vote
1answer
44 views

Crontab influences bash script if condition?

I am a bit baffled here, and not really sure how to debug this. I have a self-written bash script, that checks if a samba share is active, and if not, sends me an email. Script is in /root/SKRIPTS/, ...
-1
votes
2answers
871 views

BASH-create a 'www-data' crontab that runs a PHP file

I need to get this to run in a cron file in /etc/cron.d/: */15 * * * * php -f /var/www/nextcloud/cron.php ...but, my scripts don't run. It's permissions are set to 644 and I need to create it with a ...
-2
votes
1answer
37 views

how to make crontab that work effective? [duplicate]

and I am newbie for linux, I am sorry if this question is so dumb. I would like to know to create crontab properly, I create job as below: * * * * * /usr/src/debug/http/cron_job.sh >/dev/null 2>...
-1
votes
2answers
27 views

How to remove zip files in specific folder in my hosting by cron job?

How to remove zip files in specific folder in my hosting by cron job? I want to remove zip files in specific folder every day at 5:00PM Please help.
0
votes
1answer
33 views

Starting java program and screen with cron at boot [duplicate]

I am trying to run a java program inside a screen session at boot, I am using the following cron, but after reboot screen -ls shows no active screen sessions. @reboot /usr/bin/screen -dmS myservice "...
2
votes
1answer
40 views

Ec2 Cronjobs - High CPU usage

I have an EC2 Instance (micro) running a cakephp API. This instance serves quality validation before deploying into production. On this instance, we have 5 cronjobs that run once each minute. Those ...
1
vote
0answers
55 views

Running 'cron -f' as an unpriviledged user in docker: /var/run/crond.pid: Permission denied

I want to create a docker container with a node application which runs on a schedule. I'm attempting to have cron running in the foreground in the container and periodically start the application. ...
0
votes
1answer
59 views

Auto backup and delete a project directory using cronjob

I am trying to backup a directory, location: /mnt/project/ once in 24 hrs, and another directory inside the parent directory, location: /mnt/project/uploadDocuments/ every 3 hours using cronjob. ...
0
votes
2answers
24 views

How to trace cron actions?

I know that there are some cron jobs (run every minute) scheduled in my Ubuntu. How do I track what's running them, when the cron files (sudo su; crontab -e) are empty?
-1
votes
1answer
31 views

cronjob emails look outdated

I had some cronjobs that were running 120 times per hour. 5 were scheduled to run every 5 minutes and 1 was scheduled to run every 1 minute. They sent emails to my gmail account so I could debug the ...
0
votes
0answers
13 views

Cronjob to Flush Swap [duplicate]

I am trying to create a cronjob that will flush my swap every 30 minutes. I've tried the following: Attempt #1: SHELL="/bin/bash" */30 * * * * (swapoff -a && swapon -a 2>&1 | mail -s "...
0
votes
2answers
130 views

In Kubernetes, how can a container created from a CronJob find out when it was scheduled?

We have a Kubernetes CronJob resource that runs a Job every minute. I need the container that results from the Job to know when it was scheduled to run. Is this possible? Background info just in case ...
0
votes
1answer
63 views

Where Is Laravel Forge Scheduler In The Server?

A scheduler is set through Forge but running crontab -e in the server (Ubuntu 16.04) outputs no crontab for forge - using an empty one and then opens an empty default file. Where is it being set? The ...
0
votes
0answers
56 views

Curl cronjob for a file does not run

I have a dedicated server (SSH access) and one of my clients says that it's been a couple of days that one of his cronjobs do not work. This is the command he's using: * * * * * /usr/bin/...
0
votes
2answers
36 views

Cron hourly after boot time

Is there anyway to execute cron hourly after boot time and not at a specific time every hour? I am working with CentOS6 and CentOS 7 machines. E.G.: When my computer boots at 00:42 I want it to be ...
0
votes
1answer
190 views

commands not running from crontab [duplicate]

I have setup and cron to check if a port is busy or free and if its free then it sends and email and then start golang api service send mail is working properly but api server is not getting started ...
-2
votes
1answer
64 views

Random Sleep in Crontab/Terminal [duplicate]

I want in terminal or in crontab(both) be able to put a random time. Something like Sleep $(1-300) pkill screen && ./start just a random simple example
0
votes
1answer
87 views

how do /var/spool/(clientmqueue,mqueue,mail) work?

If - for example - cron jobs output to stdout, which is the process collecting the output and writing to these directories ? /var/spool/clientmqueue /var/spool/mqueue /var/spool/mail Where ...
1
vote
1answer
43 views

Find the source of a *nix process?

I have a dev and QA web server running on the same EC2. I've created a shell script (which is called via Cron) to check to see if a process is running and if not, restart it. Shell script: #!/bin/...
0
votes
2answers
868 views

Cron.hourly runs 17 min past the hour

I added a file to my cron.hourly folder. It runs every hour but it runs 17 min past the hour. So instead of running at 5:00, it runs at 5:17. How can I change the cron.hourly or reset it to exact ...
1
vote
1answer
52 views

Log rotation not happening with cron job- files are symlinked and forceful log rotation works

I am facing issue with logrotation with 2 of my custom files. The folder where they reside - /var/log/test is symlinked to /sample/var/log/test cron.daily log which picks up logrotate: Sep 12 03:20:...
0
votes
2answers
54 views

If run as a cronjob my shell script doesn't launch a screen

Please have a look at the following simple shell script startCleanup.sh: #!/bin/sh screen -d -m -S cleaner /usr/bin/python3 /opt/cleanup.py My crontab looks like this: * * * * * /opt/startCleanup....
0
votes
0answers
21 views

Mysql Unable to connect to the database - time to time

We have problem to run php script via crontab. There are around 70 lines that run scripts installed in different virtual servers. When few lines are executed everything is working but when we have ...
0
votes
1answer
38 views

I receive cron email every 20 minutes but don't find the cron

After I installed ssmtp I started receving the following emails: Cron <smmsp@vps123456> test -x /etc/init.d/sendmail && /usr/share/sendmail/sendmail cron-msp I looked at /etc/crontab ...
0
votes
0answers
104 views

Issues with PAM and CRON

On domain joined ubuntu 16.04, I would like to restrict users to AD groups, so I have the following lines additionally in my /etc/pam.d/common-auth (before the default ones, via /usr/share/pam-configs/...
0
votes
1answer
79 views

CRON messages being delayed for arbitrary long time in syslog

I found in a few servers's syslog that some of the CRON related messages are written in a wrong time, like the following: Aug 21 06:26:01 hty-controller CRON[30159]: (root) CMD ( python /.../...
0
votes
1answer
261 views

Host Key verification failed SSH Rsync

Two days ago I started using SSH to transfer backups of two Linux servers to another one. I created a shell script to run it in Crontab. Both servers are using Ubuntu 14.04.5 LTS My SQL-Server ...
0
votes
1answer
144 views

Why does rsync+cron fail with opendir permission denied?

I am trying to make a nightly offsite backup using rsync. There is a folder /media/raid1/backup that is to be uploaded to a different server every night using a cron job running as the user ...
0
votes
1answer
31 views

Send mail via cronjob/php, RHEL

I am trying to send an e-mail by a cronjob using a php script. The script itself works fine when executed in a shell. When it is run by cron, the attachment is missing. OS is RHEL 7 Cron entry : 30 ...
0
votes
2answers
310 views

Nginx certbot cronjob not working

I have installed certbot with the nginx module. Today I noticed that the cron that is installed automatically did not work. The cronjob in question is /etc/cron.d/certbot and the content was 0 */12 ...
0
votes
0answers
362 views

Ubuntu 18.04 cron.hourly script not running

I have a script in /etc/cron.hourly that I want to run. The script is something like this: #!/bin/sh -e echo "Doing something" eval $(do_something) exec >> /tmp/log 2>&1 and $ ls /etc/...
0
votes
1answer
80 views

How to setup multiple schedules with cron.yaml

I am working with AWS Elastic beanstalk and have my worker server running and loading job successfully. However I have a cron job that I am wanting to run at multiple hours of the same day but I am ...
0
votes
1answer
31 views

reverse ssh using systemd-cron is not connecting [closed]

I have a script that checks my home rpi2 for a file using ssh, pk auth, if the file exists it deletes it (again ssh pk auth) and opens a reverse ssh with: ssh -fN -R xxxx:localhost:22 user@...
0
votes
0answers
16 views

Crontab is not working in centos 7 [duplicate]

I am trying to setup crontab in my centos 7. I have /etc/crontab file is like below. SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root */5 * * * * root /php /root/Downloads/chat/pass.php ...
0
votes
1answer
25 views

Cron stopped working after I added another job

I hope you're doing well. I am facing a big problem with my cron jobs. Up until today I had two cron jobs to be run in my crontab to be ran at specific times of the day. Everything ran flawlessly ...
0
votes
1answer
81 views

Is the process of the cron job finished when the script it calls is executed or just when it is finished?

I am using cron to run a php script every minute and I want to lock it so it won't overlap. So my question is, if I lock the cron job with flock, will lock the process of the cron or of the php-script?...
0
votes
0answers
11 views

How to add Blesta cron to plesk [duplicate]

I've tried to add these command but non of them works. /usr/bin/php -q /var/www/vhosts/***.com/blesta_location/index.php cron /usr/local/php -q /var/www/vhosts/***.com/blesta_location/index.php cron /...
0
votes
1answer
34 views

debian cron.hourly script not executing

New to cron on debian 9 , I have a file called ipupdate in /etc/cron.hourly/ipupdate -rwxr-xr-x 1 root root 132 Jul 11 18:21 ipupdate the file has a single curl command like this: curl "https://..."...
0
votes
1answer
30 views

Cron output emails created with delay

One of our users has a daily cron job which runs for 24 hours. The output is emailed to the user in the usual way. Because the output is piped into sendmail (postfix) over 24 hours, it appears in the ...
0
votes
1answer
90 views

systemd cannot restart service file

I have written a bash script which I want to run every 60s (don't worry, I have tried the Script out, it runs perfectly). Now I wanted to implement it in systemd .service file, but so far it doesn't ...