Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
35 votes
4 answers
34k views

"tput: No value for $TERM and no -T specified " error logged by CRON process

We have a shell script which is run by CRON. The shell script in turn runs a python script which downloads files from an FTP server and then runs a java log processor on those files. The process runs ...
382 votes
22 answers
447k views

Where can I set environment variables that crontab will use?

I have a crontab running every hour. The user running it has environment variabless in the .bash_profile that work when the user runs the job from the terminal, however, obviously these don't get ...
30 votes
7 answers
94k views

Cannot get cron to work on Amazon EC2?

I've spent two days trying to understand why I can not get cron to work on my Ubuntu EC2 instance. I've read the documentation. Can anyone help? All I want is to get a working cronjob. I am using a ...
0 votes
0 answers
112 views

How to make a cron job with random offset

I have many services that need perform a sync job every 10 minutes, since these containers are using a shared resource it is not desirable, that they all do the syncing at the same time. I want to ...
23 votes
2 answers
3k views

How is % (percent sign) special in crontab?

In crontab, can you do something like this? * * * * * echo $( date +%F) >> /path/date.txt
89 votes
15 answers
122k views

How to instruct cron to execute a job every second week?

I would like to run a job through cron that will be executed every second Tuesday at given time of day. For every Tuesday is easy: 0 6 * * Tue But how to make it on "every second Tuesday" (or if you ...
155 votes
21 answers
94k views

How can I programmatically create a new cron job?

I want to be able to programatically add a new cron job, what is the best way to do this? From my research, it seems I could dump the current crontab and then append a new one, piping that back into ...
132 votes
7 answers
135k views

A cron job that will never execute

Is there any way to create a cron expression for not running the job at all? I though of using this expression : 0 0 0 1 1 ? 3099 ...which will practically do the job as it will run on year 3099, ...
1001 votes
25 answers
1.1m views

How do I list all cron jobs for all users?

Is there a command or an existing script that will let me view all of a *NIX system's scheduled cron jobs at once? I'd like it to include all of the user crontabs, as well as /etc/crontab, and ...
1 vote
1 answer
144 views

How to have an environment variable with quotes in crontab

I have a minimum example of my problem, which is trying to install a crontab that looks like this: FOO="foo\"bar\"bin" 0 0 1 * * ls by running crontab crontab (I have it in a ...
33 votes
6 answers
42k views

Why ssh fails from crontab but succeeds when executed from a command line?

I have a bash script that does ssh to a remote machine and executes a command there, like: ssh -nxv user@remotehost echo "hello world" When I execute the command from a command line it works fine, ...
45 votes
11 answers
33k views

ssh-agent and crontab -- is there a good way to get these to meet?

I wrote a simple script which mails out svn activity logs nightly to our developers. Until now, I've run it on the same machine as the svn repository, so I didn't have to worry about authentication, ...
54 votes
4 answers
103k views

Test run cron entry

I added a cron job recently, but made a mistake in the path while giving the command and hence, the job never succeeded. Is there some way to test the cron changes we have done? Please note that I ...
73 votes
3 answers
107k views

How to skip saturday and sunday in a cron expression? [closed]

Hi I want to create a cron expression excluding saturday and sunday.
78 votes
2 answers
36k views

How does cron internally schedule jobs?

How do "modern" cron daemons internally schedule their jobs? Some cronds used to schedule a run every so often via at. So after a crontab is written out, does crond: Parse the crontab for all ...

15 30 50 per page
1
2 3 4 5
34