Questions tagged [cron]
cron is a task scheduler based on clock time that runs on Linux-based machines.
912
questions
0
votes
0
answers
23
views
Why doesn’t /etc/logrotate.d/tomcat run daily but will only take effect if I manual trigger it?
I have a Talend Data Stewardship application in my server and I would like to rotate the catalina.out log file.
Thus, I referring https://dzone.com/articles/how-rotate-tomcat-catalinaout, and create a ...
0
votes
0
answers
56
views
Ubuntu bluetooth audio via cron only works when logged in
I am running Ubuntu server (headless) and have a bluetooth speaker connected to it. The objective is to play mp3 via cron.
Audio plays fine with cron using play command while I login or I keep a ssh ...
1
vote
0
answers
78
views
Copying files from Linux server to windows machine over SSH, using expect script and crontab is not reliable
We have a server that is producing reports from some elements in two formats. PDF and DOCX. I created a crontab job to automate transfer of these files from the server to one of the local Windows ...
1
vote
0
answers
58
views
remote host has disconnected error with sshfs as cron job on openbsd
I am trying to automount a directory with sshfs using crontab. the sshfs command:
/usr/local/bin/sshfs -o IdentityFile=/home/user/.ssh/id_ed25519.pub,idmap=user,allow_other,uid=1000,gid=1000 user@...
0
votes
1
answer
39
views
anacron doesnt work as expected
Trying to schedule a job to run every day with cron or anacron. Search the forum for resolution but still without any success.
Changing shell=/bin/bash or bin/sh didnt do anything.
My system lubuntu
...
0
votes
1
answer
72
views
Cron job does not execute according to time schedule
Consider the following cron job:
* 22-23 * * * /usr/bin/curl -u username:paswword http://api.example.com/api/test2.php
Now, according to this, the cron job must run every minute starting from 22h00 (...
0
votes
1
answer
85
views
The Cron Service itself failed how do I find out why
I have a remote raspberry pi that runs 24/7. It is running Debian bullseye. Tasks that normally run daily failed to send some mail failed and I was told about it by the normal recipients. When I ...
2
votes
0
answers
87
views
How to determine what script is deleting files in Linux?
I run a Plex Media Server (PMS) on a ubuntu 22.04 system. There's been no update to the PMS libraries for a while, and I recently started adding a few movies to the collection. But what I've found ...
0
votes
1
answer
161
views
How to find and delete folders that are 15 days older using cron jobs in Truenas Scale?
I have security camera in my home it upload recorded videos to my Home NAS every one hour time intervals which is powered by Truenas Scale Operating System now all the footage are stored in my NAS I ...
0
votes
0
answers
87
views
Starting a Screen Sessions Upon Reboot and Executing a Script in It
I would like to have a certain script run in a screen session when an Ubuntu 22.04 system starts up. The command I came up with is as follows
screen fauxpilot -dmS sh ./fauxpilot/launch.sh
However, ...
0
votes
0
answers
35
views
Is this werid gcc1.sh cron job a virus? Ubuntu 22.04.01 LTS
This file gcc1.sh in cron.hourly seems a bit odd. This is on a turnkey linux appliance running a wordpress site.
I can't move it or delete it
>lsattr gcc1.sh
----ia--------e------- gcc1.sh
File in ...
0
votes
0
answers
24
views
crontab tar archive on macOS not recursive
I have a script to archive a directory on macOS:
#!/bin/sh
BACKUPNAME=$(date "+%Y-%m-%d@%H:%M:%S")
BACKUPNAME="local-vaults-$BACKUPNAME.tar.gz"
tar czfh "/Users/henrik/...
0
votes
1
answer
118
views
Failing to run an infinitely running command at startup
I want to use gpu-screen-recorder to record replays. I installed it using flatpak and am using the following command to start the replay mode:
flatpak run --command=gpu-screen-recorder com.dec05eba....
2
votes
1
answer
138
views
Within Docker, how to correctly add a task to cron programmatically (scripting)? no errors are perceived in log
After several days of messing around with Docker, I have not found a solution to my problem.
In short, I have tried to add cron to php:8.1-apache-bullseye and pass it a file with the task that I want ...
0
votes
1
answer
79
views
OSX cronjob doesn't have permission to touch existing files in Downloads?
I recently updated from OSX 13.2 to 13.5.2 and all my cronjobs are failing now.
I'm trying to run rsync in a cronjob but it keeps failing, and I ultimately narrowed that down to my cron jobs not ...
0
votes
1
answer
291
views
rsync - Operation not permitted when script is launched by cron
I've got a script that basically launches the following command
rsync -avh --progress --no-relative "$SOURCE_PATH/" "$DESTINATION_PATH"
and vice-versa (destination to source). ...
0
votes
0
answers
98
views
lftp in shell script fails with "pseudo-tty allocation failed" only when run via cronjob
I am trying to create a shell script which copies a file to a foreign server using SFTP (because SSH is not available on the foreign server). The script works as expected when run via console, but it ...
0
votes
1
answer
371
views
busybox crond avoids concurrent processes for first 10 minutes?
I have a script that's executed every minute by cron in an Alpine container. Said script may run for long time, which is why it handles locking itself.
Just now I noticed the busybox' crond avoids ...
0
votes
1
answer
137
views
How to properly set sudo crontab to backup files with superuser rights nightly?
I'm writing a script to backup some dirs such as /etc in a nightly backup.
The script works if I run it manually and input a password, but fails to launch in crontab
For testing purpose I've made a ...
1
vote
0
answers
454
views
cron resource temporarily unavailable
I have a proxmox server with a ubuntu lxc container. cron is not working. I am working this as root:
cron -l
cron: can't lock /var/run/crond.pid, otherpid may be 21952: Resource temporarily ...
0
votes
0
answers
85
views
CronJob on MacOSX seems to be delayed. Is it normal?
I am running a cronjob on MacOSX. It just prints some information on a file every 5 minutes.
I added a date command, and I see that the job runs sometimes after 10-15 seconds, but other times it can ...
0
votes
0
answers
58
views
profile sync daemon crontab necessary?
I'm running ubuntu 22.04 and installed profile-sync-daemon. The configuration was pretty easy by simply using the defaults and activating the daemon:
systemctl --user start psd
systemctl --user status ...
0
votes
0
answers
46
views
Executing a service automatically or a script on init without a init system or cron
Little background: I have this Synology server with Linux that is running Docker Images. There is one docker image that has a ton of content already within and I cannot recreate it, so basically is ...
0
votes
1
answer
54
views
Run Command after Laptop unfold
I want to run a bash file at a specific moment a day. (8:00 and 20:00).
I've already managed to do this via crontab and also on startup if my computer was shut down at the time. My only problem is ...
1
vote
2
answers
603
views
Running shell Script via Crontab
So I've tried to run a shell script via crontab.
My Crontabs look like this:
00 20 * * * $HOME/Bilder/Hintergründe/.background_skript/background_night.sh
and my background_day.sh looks like this:
`#!/...
1
vote
1
answer
379
views
How to tell which files are new or have been modified between calls of a script
I want to call a shell script regularly, and in it I need to process the files present in a directory tree that are new or that have been modified since the previous call of the script.
My 1st thought ...
0
votes
0
answers
345
views
sendmail cron job successfully sends out emails, but emails are not reaching my inbox
I created a script /etc/cron.hourly/test-hourly to send an email to me:
#!/bin/bash
EMAIL_TO="[email protected]"
EMAIL_CC="[email protected]"
SUBJECT="Cron hourly test $(...
10
votes
5
answers
4k
views
Cron can't find executable which works in terminal?
I've written a small tool in C++, compiled it, made it executable, and move it to /opt/tools/bin. The latter is a directory I created to store small, custom programs. I export it to $PATH in my ....
1
vote
0
answers
36
views
Where are the files generated from a binary launched using launchd?
I am trying to setup a cron job using launchd, seemed quite straight forward with systemd on linux, but on mac, even though I have the process running (it is a local server, and I can confirm the API ...
0
votes
0
answers
210
views
How to prevent systemd.timer immediately restart a service?
I have a daemon service that needs to keep working 08:00~16:00 every workday, and I want it exit at 16:00, and keep exited at rest time range and weekend.
I make a systemd.timer for it as following:
[...
0
votes
0
answers
151
views
mount and systemctl not executing inside crontab
Under root, i run crontab -e and write :
0 21 * * * systemctl stop transmission-daemon && umount /mnt/WD5 && hdparm -y /dev/sda
I also tried
0 21 * * * mount /mnt/WD5
None of them ...
0
votes
0
answers
101
views
CRON to Check if a webapp is working properly and report what happened if not
This is my first iteration in bash:This webapp does not have postgres but Apache 2.4, Tomcat 8.
I check first the 200 http response. Then if http server is running and if the tomcat also does.
I ...
0
votes
0
answers
341
views
anacron Can't open timestamp file for job cron.daily: Permission denied
Why is anacron failing to run jobs? I just added a weekly backup job, but it fails to run with anacron -f.
Here's the error in journalctl: anacron[28209]: Can't open timestamp file for job cron.daily: ...
0
votes
2
answers
155
views
Cron job supposed to run on Tuesdays are running other days?
I have the following Cron rule:
0 8 1,2,3,4,5,6,7,14,15,16,17,18,19,20 * 2 /root/command.sh
My objective is to run the /root/command.sh on Tuesday every two weeks.
Crontab.guru returns the following:
...
2
votes
1
answer
159
views
list of files (ls /dev) is different when run on command line vs. via crontab
Why can't cron ls certain files in /dev using my script ?
The script can list /dev completely when run from the command line. The same script run from either cron setup cannot see (list, ls) most of ...
1
vote
1
answer
392
views
not able to mount filesystem (sshfs) using crontab
I have sh script file which works properly when running from command line using -
./start.sh
which starts a tomcat server and mounts a drive with sshfs
But when i do
crontab -e
@reboot /home/start....
0
votes
2
answers
533
views
How to setup cronjob with automated emails in linux?
I've been working on creating a script to scan a series of mailboxes on a linux server, find ones that have more than 250 emails in the mailbox, and then send an email with the name of those mailboxes ...
1
vote
0
answers
763
views
Nginx: How to close connections that have been open for over an hour?
I am using an Nginx server with Debian 11 to offer download resources.
I need to reset client connections that have been open for over an hour.
Currently, I restart the Nginx service via a cron job ...
0
votes
1
answer
817
views
php and apache not seeing anything in there defined tmp dirs
we have standard php and apache but not seeing anything in there defined tmp dirs
How to check logs for non application 500s?
I have actually 2 issues one is routing logs for https://www.test.com
...
0
votes
1
answer
92
views
SSH Tunnel via crontab with 2FA gives EOFError
I'm trying to setup a crontab which opens an ssh tunnel. Unlike other questions here and on stackoverflow, the server I'm connecting to has a 2FA which prompts the user for a password. However, I don'...
0
votes
0
answers
42
views
I created a cronjob years ago, now it is still running on the server but I can't locate it with "crontab -e", what can I do?
two years ago I created a cronjob which execute a python script to backup stuff. Now, the thing is that this cronjob is still running:
/var/log/cron.log.1:Oct 9 20:00:02 syslogngsrv CRON[28292]: (...
0
votes
1
answer
67
views
Cron Disrupting VBoxManage Commands
I am on Ubuntu 20.04 desktop, running Virtualbox 6.1 and I use Webmin to run a very simple cron job to take daily snapshots of my virtualbox test server as follows:
VBoxManage snapshot VminServer ...
2
votes
1
answer
102
views
Cron task set to change Gnome 3 background doesn't update the background
I've made this simple script:
#!/bin/bash
# If started as root, then re-start as user "cyril":
if [ "$(id -u)" -eq 0 ]; then
exec sudo -H -u cyril $0 "$@"
fi
wget -...
1
vote
0
answers
134
views
Trigger graphical password prompt from a cron job
I have a few script to automate linux system backups with Borg. But those script need me to input a password through pinentry (gpg password prompt), in order to unlock my SSH key or the backup ...
0
votes
1
answer
126
views
wordpress automatic updates via cron no root privileges?
this script is run by update.sh wich is run by cron every day at 2 o'clock, it allows wordpress to be updated automatically via cli (needs to be installed before) actually runs fine, when run as root
...
0
votes
0
answers
82
views
When is the right time to set up iptables after system reboot?
I have a shell script that sets up a packet filter using iptables. The script works fine, but since im using iptables, the configuration gets reset after a system reboot and the packet filter no ...
0
votes
0
answers
162
views
Screen fails to properly load when called with crontab
What I'm doing
I've been migrating one setup to another, copying configuration and installing dependencies, I was about to be done until screen didn't work as intended.
I have a script that I keep ...
0
votes
1
answer
211
views
cron.d script launching then dying
Many stack posts seem to suggest something like:
* * * * * root /usr/bin/pgrep -f 'socat -T10 TCP4-LISTEN:22222,fork UDP4:localhost:22223' || (/usr/bin/socat -T10 TCP4-LISTEN:22222,fork UDP4:localhost:...
0
votes
1
answer
207
views
Duplicity cron not working
I'm trying to run Duplicity backups via a cron script with --encrypt-key and a GNUPG key ID (from gpg --list-secret-keys).
It's failing with /root/backup.sh: 5: --encrypt-key: not found but if I ...
0
votes
0
answers
192
views
git produces no output when called from script via cron (log/shortlog)
I've got a script git-test going to a local git repo and calling git shortlog to keep track of recent changes. For testing purposes, I just used these lines:
#!/bin/bash
cd /myrepo.git
result="$(/...