New answers tagged

0 votes
Accepted

How do i run a cronjob every 100 days

Consider using a systemd timer rather than cron since that has native support for tracking time since last (re)boot. Create a file, for instance reboot.timer in /etc/systemd/system [Unit] Description=&...
  • 163
0 votes

How do i run a cronjob every 100 days

I need to run a reboot every 100 days That's a very suspicious requirement. Via Cron.... 0 23 * * * find /var/run -mtime +99 -name reboottimestamp && touch /var/run/reboottimestamp && ...
  • 19.9k
0 votes

Can't run AWS CLI from CRON (credentials)

A solution for me was to set both the config and credential file location via environment variables export AWS_CONFIG_FILE="/root/.aws/config" export AWS_SHARED_CREDENTIALS_FILE="/root/....
  • 101
1 vote

How to change the default email address for the non-root user in postfix?

To redirect emails for user admin to another email address or user, create an alias in /etc/aliases : admin: user # For a local user mapping or admin: user@remote.com # For a remote user mapping ...
  • 111
0 votes

start-stop-daemon: command not found . This error only occurs at boot time in a cron job

Cron jobs are not executed in the same environment as the rest of the boot sequence. For this reason /usr/sbin/ is not in $PATH for those. Alter the cgbscript so that start-stop-daemon appears with ...
0 votes

How to exclude a service under /etc/logrotate.d/ to run with the main logrotate job

As I write this, I'm using logrotate version 3.20.1 on Arch and in the man page is a feature I suspect has been added since this question was new in 2017. In addition to tabooext there is now taboopat ...
  • 404
-1 votes

Crontab query - won't execute program

Thanks Romeo, I had to go in another direction. Apparently cron @reboot can't be used for applications that require desktop GUI as these will attempt to start your programs too early in the boot ...
  • 1
0 votes

Crontab query - won't execute program

The cron is executed, but probably it need some environment variables, PATH, etc. What you can do is to create shell script like this: source /home/pi/.bash_profile /home/pi/auroramon-1.07/src/...
  • 3,195
0 votes

Crontab not found in docker image

Yes, it's normal that there is no cron in a Docker container. Except when you want a container for cron. By principle you have only a single service in a container, along with its dependencies. If you ...
0 votes

Crontab not found in docker image

Here is how I run one of my cron containers. Dockerfile: FROM alpine:3.3 ADD crontab.txt /crontab.txt ADD script.sh /script.sh COPY entry.sh /entry.sh RUN chmod 755 /script.sh /entry.sh RUN /usr/...
4 votes
Accepted

What is supposed to happen to running cron processes after modifying them with crontab -e?

@reboot : Run once after reboot. So, for your particular use case 3. A systemd service may be a better way to go with a long running process though.
  • 114k
0 votes

Crontab not found in docker image

Typically the cron files have nothing related to cron/tab. If the periodical job is critical to a program (e2scrub in your case), its package should depend on cron. So if you want e2scrub to run ...
  • 1

Top 50 recent answers are included