Skip to main content
Share Your Experience: Take the 2024 Developer Survey

New answers tagged

1 vote

Crontab run after deleting a file

No, don't delete your file but if you want to remove the execution just remove the according line while using crontab -e it will edit the crontab using your preferred EDITOR. You can backup ...
admstg's user avatar
  • 734
2 votes

Unison via cron, how to deal with one job still running as the next one starts

Reasons I am running Unison as a cron job rather than with -repeat (presumably as a systemd service) I would actually suggest that systemd is a perfect fit for when you want "cron but single ...
Bob's user avatar
  • 307
0 votes

Unison via cron, how to deal with one job still running as the next one starts

I also use flock in cron job shell scripts to avoid running more than one at a time. I use a different approach than has been suggested in a previous answer. I'll show the code and describe the ...
Sotto Voce's user avatar
  • 4,276
5 votes

Unison via cron, how to deal with one job still running as the next one starts

Unison (version 2.51.2) creates its own lock files. Testing it just now, running unison sync twice from the command line, the second while the first was still running, I got this error (with stuff ...
Mike Pierce's user avatar
10 votes

Unison via cron, how to deal with one job still running as the next one starts

If you want to avoid launching a second instance of unison when another process is already running, you can control startup using a lockfile via the flock command. This is a general solution, it works ...
larsks's user avatar
  • 35.3k
0 votes

Raspberry-Pi 5 cron job not execute the command after reboot

Why crontab doesn't execute a scheduled bash script? 673918 Jobs run through cron, or startup scripts, or systemd scripts, aren't run in the same runtime environment that you have on your desktop. ...
waltinator's user avatar
  • 4,935
4 votes

Are directories such as /etc/cron.daily and similar restricted by naming rules?

As explained in man 8 cron on Debian (the source of the quote): Support for /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly and /etc/cron.monthly is provided in Debian through the default setting ...
Stephen Kitt's user avatar
1 vote

crontab /bin/zsh: can't open input file:

Gairfowl’s comment resolved my problem: Is this on macOS? If so: Seamus’s answer over on the sister site Ask Different explains that cron must have "Full ...
Mihail's user avatar
  • 41
2 votes

Possible Malware: Unable to track starting point

(Rewritten based on OP's comments) The cpu_hu seems to execute as user postgres, which suggests it might have been started by using a weakness in your PostgreSQL database engine or its configuration. ...
telcoM's user avatar
  • 98.1k
1 vote

Cron job with for loop, executing same command several times to create multiple threads

The outer double quotes should be removed, and it's an error to use both & and ; to terminate a statement - see for example Using bash "&" operator with ";" delineator? As ...
steeldriver's user avatar
  • 81.4k
1 vote

troubleshooting crontab not running

You are using ./media when I suspect you meant to use /media. If you use ./ that means you are giving a path relative to your current directory. So, for example, if you are in /some/dir/, then ./media ...
terdon's user avatar
  • 243k
0 votes

Cron job still running after deletion from cron.hourly

The cron utility does not "run from" /etc/cron.hourly rather it pulls its configuration from each of the /etc/cron.* directories. I would examine the cron server invocation script to see ...
Mei's user avatar
  • 1,146
0 votes

how to execute cron jobs based on user's time zones

I know of no cron implementation that will allow you to specify the timezone per entry. So, the solution here has to be more complex. Assuming that timezones differ from each other by no more than 15 ...
Chris Davies's user avatar
1 vote

Why is my crontab giving me a bad username error?

From man 5 crontab: The ``sixth'' field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or % character, will be executed by /bin/sh ...
ariel marcovitch's user avatar
1 vote

start command at given time interactively in terminal

If the "ugly" part is just calculating the sleep time, you can script it with four commands. I made them into a single command (with ; \) to avoid any typing delay, but you could script them ...
Paul_Pedant's user avatar
  • 8,909
0 votes

Prevent ssh-keyscan from generating output

An old question, I wonder why no one has suggested the following variant: (ssh-keyscan $host >>/root/.ssh/known_hosts) 2> >(grep -vE '^#') This will only suppress the stderr output ...
mark's user avatar
  • 387
0 votes

Inherit permissions not working with crontab copy

Did you ever try this : tar cfp - /home/usr1/jobs/test3 | ( cd /s0/folder1/;tar xfp -) reference this .
James's user avatar
  • 49
0 votes

How to modify $PATH globally

You can add environment variables in your crontab file itself like this: PATH=/usr/bin:/whatever/bin HOME=/home/myuser 6 9 * * * python /path/to/ &> $HOME/out.txt
lauhub's user avatar
  • 980
0 votes

How to modify $PATH globally

If you look at the contents of /bin, you'll see a lot of symlinks because many programs aren't placed directly into the bin dirs. You can do the same: sudo ln -s /opt/python/3.9.2/bin/python /usr/bin ...
J-Cake's user avatar
  • 219

Top 50 recent answers are included