Questions tagged [cron]

Cron is used to execute scheduled commands. It acts as a task scheduler on Linux and UNIX systems which will execute commands at specified times set by the user. Cron has a great deal of customization and is often used on server environments where common tasks are run on a regular basis.

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

How can i schedule a automatic synchronize of two folders on Grsync?

Hello, So, i have two disks on my computer and i had synchronized a folder from the main disk to the external one with Grsync but now, instead of doing it manually i was wondering if it possible to ...
0
votes
2answers
22 views

No Error with Cron but does not work

I have written a simple python script that sends notifications using Pushbullet. The command works perfectly in the terminal but does not work automatically. The syslog for Cron: Nov 29 18:33:01 ...
0
votes
1answer
35 views

Crontab, can't execute all the script

I need to run daily a shell script which contains the steps of the model Weather Research Forecasting. I used cron for this. The first executable of the script (ungrib.exe) works perfect, but the ...
0
votes
0answers
16 views

Launch GUI on startup and launch it again if failed (Systemd VS Cron)

I have a python application that I need to be launched on Ubuntu startup I would like also that application to be launched again if it closes/crashes. That is something that Systemd can handle, but ...
9
votes
3answers
541 views

Run multi scripts in a folder with cron

I'm working with many scripts. So I do add/remove scripts with "crontab -e" so many times. I tried to make an "Available/Enabled" structure for these. Example: This is my ...
0
votes
1answer
28 views

Cron task does not get executed [duplicate]

I have a list of commands to run every day. When I copy paste it directly to terminal and run it is working but when I copy paste the same command to cron its not working. This is the command 0 10 * * ...
0
votes
0answers
14 views

Making A Shell Script Run Forever [duplicate]

I have an Ubuntu 20.04 VM. I connect to it via SSH and run ./script.sh. It runs for as long as I am connected to the VM, but the moment I disconnect, it stops running. I understand that I can use ...
0
votes
1answer
43 views

Cron job doesn't run script python in the specific directory

I created a simple python script to add, commit, and push all files in some directory. I want to do this daily by a scheduled cron job. But unfortunately, the script doesn't run. Before this, I do ...
0
votes
0answers
40 views

crontab -e does not save the cron for current user

I am using Ubuntu 20 under AWS Ec2 instance. I have created a custom user other than the default user ubuntu. When I try to edit the cron file by crontab -e it opens the from file and shows the ...
0
votes
1answer
65 views

expect script not working in cron but runs successfully in terminal

Here is my expect script named as script.exp which runs successfully when executed from terminal. But it doesn't run when scheduling through cronjob. #!/usr/bin/expect -f set timeout -1 spawn ./...
0
votes
0answers
63 views

Can't execute TimeShift from crontab -e

Whenever I try to to a 0 4 * * * timeshift --create --comment "Daily Backup Cron @ 04:00" --tags D it always ends with ** (process:1797061): CRITICAL **: 04:01:03.801: long_parse: assertion '...
0
votes
0answers
31 views

Controlling cron jobs using third-party apps

I'm quite new to using cron jobs on my personal ubuntu server, so, I was wondering if there is any way that I can schedule cron jobs to control certain services such as Nginx from lets say Google ...
0
votes
0answers
25 views

Where are the 'sudo crontab -e' entries stored?

I want to backup my extensive crontab -e entries, where are those stored when I access them as user with sudo crontab -e ?
0
votes
1answer
47 views

Patching on a specific date each month - how?

I am looking to setup an environment where our Staging and Dev servers are patched in the 2nd week of a month - lets say Thursday. Then 2 weeks later - again on Thursday, we patch production. This ...
0
votes
2answers
105 views

I can't keep a bash script alive

I found and slightly modify the following script, that monitor the notify-send notifications and dump them in a file. #!/bin/bash logfile=$1 dbus-monitor "interface='org.freedesktop....
1
vote
1answer
119 views

rsync refuses to exclude directory

I'm trying to make a OS backup with rsync and have put this into crontab. which by itself works great, but for some reason it refuses to take /export into account while looking at the excludes... 0 2 *...
0
votes
1answer
41 views

Unattended Upgrade End Script

I have the need of notifying my fleet management system every time unattended-upgrades run, and sending some information on the packages updated. Is there any way to detect the end of unattended ...
0
votes
0answers
35 views

Is there a VisualCron open source equivalent for Debian based distros?

I'm sometimes using this Swiss Army Knife tool called VisualCron when I'm working on Windows for managing many... many tasks, from database backup/restore, to launching remote scripts, and so on. I ...
1
vote
1answer
242 views

Read cron output with Thunderbird 91?

On Ubuntu 21.10, Thunderbird 91 does not support movemail (Unix Mailspool) accounts: Removed support for movemail Support for movemail has been removed. Please set up an IMAP or POP3 account to ...
1
vote
1answer
65 views

Cron job seems to be running but no output and got killed after a while

I am trying to run my python scripts with crontab. I have 2 python scripts in the same directory. The first one file1.py has just 1 line print(1). The second file file2.py begins with print(2) but ...
1
vote
0answers
51 views

Fail to execute command on startup

I want to run a simple command after my ubuntu starts up and network services are established (it should do so no matter wheater I'm logged in or not) If I run the command manually, it start's up the ...
0
votes
1answer
38 views

How to make all cron jobs output to syslog?

I can configure individual cron jobs to output to syslog by making them explicitly pipe their output there, with e.g. | /usr/bin/logger -t MYJOB. Is there any way to make all cron jobs output to ...
1
vote
0answers
34 views

How do I configure the cron daemon flags?

I'd like my Ubuntu 20.04 server to run crond with the -L15 flag. What's the right way to configure it to do so? See man cron. /etc/init.d/cron does not give me the impression I should mess with it.
0
votes
0answers
33 views

CRON doesn't run

I had to reinstall a whole stack on an EC2 instance because a colleague mess up the previous one (not able to SSH anymore). Long Story Short: New EC2 is running. We have to run 2 jobs by a CRON job. ...
0
votes
1answer
91 views

Issues with CRON job executing on Ubuntu 20.04 with PHP 7.4 FPM

I am having issues properly setting up the following CRON job to automate backups on my client's website. The site is Joomla-based and I am using Akeeba Backup to handle the backups. The ...
0
votes
0answers
29 views

Crontab not running files

I've been repairing a problem in my crontab, it ran all the files without any problem but suddenly it stopped running, it shows in the syslog that the file was executed but I did a test php that built ...
0
votes
1answer
65 views

Do python scripts that update things online need a virtual environment to run?

I have been trying for a while to schedule a python script in cron to run twice a day. The script uses a couple API's to pull information from a website and update a google spreadsheet with the ...
1
vote
0answers
66 views

Is there a way to queue scripts in ubuntu/debian/linux?

I have a strange question(at least to me!), but I'm not sure how to even approach it. Background I have a few batch jobs(python scripts called via cron or python script being called by bash script). ...
1
vote
2answers
89 views

Why doesn't my crontab -e execute the .sh script?

In sudo crontab -e I have this: */2 * * * * date >> /home/rki/test.log */5 * * * * sudo sh /home/rki/docker-compose-stuff/dokuwiki/backups/dokuwiki_backup.sh */2 * * * * date >> /home/rki/...
-1
votes
2answers
105 views

Running a bash shell using a password with a cron job

I have a bash shell to back up a database that requires a password to open it. I want to run on a cron job, but how do I make it run automatically without filling in the database password? ubuntu ...
1
vote
1answer
80 views

My cron jobs aren't running when trying to save the script output to a txt file

I am trying to have a python script run twice a day- once at 8:00 AM and again at 8:00 PM. My hope was to store the script output to a txt file on my computer named LOG_{date-time}.txt so I could look ...
0
votes
1answer
29 views

How to execute a ConnectAll Application restart script using a cron Job

Could you please guide me with the following, Adding the ConnectAll Application restart script for reference: #!/bin/sh -e # JIRA startup script #chkconfig: 2345 80 05 #description: JIRA # Define ...
0
votes
0answers
25 views

Fix auto-rerun of crontab script if it fails the first time

I want to re-run my script on crontab if it fails the first time. i know i can schedule one more time ín the cronjob but i want to write it on the script
0
votes
0answers
25 views

How to sync crontab with fcrontab, i.e. timer-based job and time-based job

Having 2 schedules set: Cron running every 8am 0 8 * * * myCronJob.sh Fcron running every 61 minutes: @1h1 myFcronJob.sh They will eventually bump into each other and it will not work because in ...
0
votes
1answer
65 views

How to Insert Data Field Table SQL Server from another SQL Server in different ip from Ubuntu 20.04?

Hai I need help to insert data from one sql server ip to another sql server ip. I've tried using sqlcmd but it not work like mysql syntax on bash which can insert data using csv or txt file after I ...
2
votes
2answers
207 views

crontab date definition for only second Wednesday of the month

How do I define crontab date for second Wednesday (of every months) only? I would appreciate your help.
0
votes
1answer
165 views

Help to complete a script (fake google IPs, maybe fail2ban)

I monitored the google ip that accessed my server for a few years and identified these masks: 66.249.64.0/19 66.102.0.0/20 64.233.160.0/19 34.64.0.0/10 216.58.192.0/19 74.125.0.0/16 Then I created ...
0
votes
1answer
55 views

paplay not working from cron

A little more than a year ago I wrote a notifier app. (on Ubuntu 16.04.7) which played some audio with paplay and then put up a yad window with the text of the notification. This could be run either ...
0
votes
3answers
43 views

Can't get crontab to work as expected

I want to do a daily backup of my home directory by executing the following script (I can write to /home): #!/bin/sh -e cd /home ls -l rm -f silbar.tar.gz echo "starting tar" ...
1
vote
1answer
47 views

Sudo crontab -e vs crontab -e running command as sudo

Say I need to run a php script with root permissions every night, is it better practice to run it from the root crontab, or from user with sudo permissions crontab, 'sudoing' in the command. i.e. In ...
0
votes
1answer
36 views

cron job script not executing terminus command

I'm new to cron jobs implementation. On my local, I have setup crontab on kubuntu system, but when the cronjob executed, it do not execute terminus commands inside it. When I run terminus commands ...
0
votes
1answer
59 views

Cron job to power off when AC is unplugged not running

I'm trying to run a simple bash script that turns off my notebook if it is not pluged on AC with a cron job. My script is as follows: #!/bin/bash if ! on_ac_power; then poweroff fi ...
4
votes
3answers
1k views

First time crontab. Is this viable?

I tried to do some "coding" myself and this is what I came up with: 00 02 * * 1,3,5 sudo shutdown -r @midnight sudo apt-get update && sleep 60 && apt-get ...
1
vote
1answer
920 views

Cron job delayed by ~1 second

I am running the following cron job * * * * * date "+\%Y\%m\%dT\%H\%M\%S" > /path/to/log 2>&1 but it's running around a second too late, as it writes e.g. 20210817T210001 How ...
2
votes
1answer
270 views

How to know if crontab implements @reboot?

according to crontab.guru, many functions like @reboot, @daily, @annually ... are not standard. Is there any way to know the one implemented on my system (Kubuntu 21.04) ? I have tried the man-page, ...
0
votes
1answer
123 views

How can I find out when systemd schedules apt to auto-upgrade my packages?

The other day I found out that my Docker container had been killed as the docker daemon had been automatically upgraded on an AWS box I was running. journald showed these messages in the relevant time ...
1
vote
1answer
423 views

Auto launch Polybar at boot with default WM (GNOME, Mutter, 21.04)

I'm new to both polybar and Linux. I have follow the tutorial on Github: Created a file called ~/.config/polybar/launch.sh Make it executable (I have confirm this through the GUI) Here's the ...
1
vote
1answer
65 views

How can I find out why my crontab is not working?

I am a novice ... I will just get that right up front. I have a simple Ubuntu 20.04 LTS server used only as a minecraft server. The crontab is giving me some problems */10 * * * * screen -S minecraft -...
1
vote
1answer
35 views

CronJob Not running

I have prepared a py Script to update my Django database once a day. Trying to use Crontab along with python to run the py script. 0 1 * * 4 /usr/bin/python3 /home/user/folder1/script1.py 0 2 * * * /...
0
votes
0answers
20 views

Schedule shutdown / startup every day Ubuntu 20.04

i search for a Solution for the Ubuntu 20.04. Server, how can i shutdown at 23:00 (11pm) and startup at 7:00 (7am) o'clock? WOL is aktive in the BIOS. ethtool is install. The eth is "enp5s0" ...

1
2 3 4 5
41