-   Programming (
-   -   Simple bash script (

Soulful93 06-04-2005 08:16 PM

Simple bash script
I've written a simple bash script, and scheduled it to run as root with cron.

I'm directing all output to three different files on my desktop and when I manually run the script it works fine, when cron executes the script I get two empty output files on my desktop.

Cron is executing the script with root permissions so I can't figure out whats going on.


cd /root/Documents/Installed/Rootkit/rkhunter/files
rkhunter --update > /home/soulful93/Desktop/Security_Rkhunter.txt
rkhunter -c --skip-keypress >> /home/soulful93/Desktop/Security_Rkhunter.txt
cd /root/Documents/Installed/Rootkit/chkrootkit*
./chkrootkit > /home/soulful93/Desktop/Security_Chkrootkit.txt
freshclam > /home/soulful93/Desktop/Security_Freshclam.txt

By the way the Security_Chkrootkit.txt file always contains output. The Security_Rkhunter, and Freshclam are the two I'm having problems with. So, any ideas? :scratch:

ilikejam 06-04-2005 08:26 PM


Try replacing the > redirect with &>
That will pipe std. error to the files as well as std out.


All times are GMT -5. The time now is 09:13 PM.