0
votes
2answers
69 views

How can I ensure that a custom environment variable is set before cron runs a task?

I recently experienced a logwatch issue that is fixed by running export DATE_MANIP=DM5. cron seems to forget this when I logout (presumably because it's not saved). Where can I add this custom ...
2
votes
1answer
1k views

Users home path in a bash script

I'm writing a bash-script that will be run as a cron job everyday. Very basic, I was wanting to change the wallpaper daily. I have mint-14 with mate. The thing I'm getting caught up on right now ...
-1
votes
3answers
1k views

How to run a shell script with export command in crontab

I have a shell script that exports values of variables when executed. The same values will be used in another script. How to run this script(test.sh) in cron. #!/bin/sh export I="10" echo $I I will ...
8
votes
2answers
629 views

Interactive shell with environment identical to cron

I am aware of a lot of pitfalls in the magic world of crontabs, but sometimes it would help troubleshooting a lot when you have some smart way to enter an interactive (bash) shell with exact identical ...
1
vote
1answer
166 views

crontab sets up user variable, redirect output, and detect connetcted network

I have three problem, all of them are about crontab. Can I access $HOME variable in crontab ? for example, use $HOME like this: PATH=$HOME/bin:$HOME/scripts:$PATH ? or * * * * * echo "test" > ...
15
votes
6answers
27k views

How can I run a cron command with existing environmental variables?

How can I run a cron command with existing environmental variables? If I am at a shell prompt I can type echo $ORACLE_HOME and get a path. This is one of my environmental variables that gets set in ...
7
votes
5answers
4k views

Run script in a non interactive shell?

I have a cron job that is running a script. When I run the script via an interactive shell (ssh'ed to bash) it works fine. When the script runs by itself via cron it fails. My guess is that it is ...
4
votes
2answers
3k views

How to run a cronjob in my regular environment?

Both the shell and environment variables that cronjobs are run in is completely different from the ones presented to me in gnome-terminal. How can I run a cronjob under the same circumstances as if I ...