Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 06-04-2005, 07:16 PM   #1
Registered: Dec 2003
Location: Denver, CO
Distribution: SuSE 9.2 Slackware 10.1
Posts: 137

Rep: Reputation: 15
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?
Old 06-04-2005, 07:26 PM   #2
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96

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



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple bash script lp449 Linux - Networking 3 08-02-2005 04:25 PM
Simple Bash Script Help njdownes Programming 2 03-05-2005 07:35 AM
Simple Bash Script dmedici Programming 9 12-31-2004 03:48 AM
Help with simple bash script - please tw001_tw Linux - Software 5 12-19-2004 09:02 PM
Simple BASH script fio Linux - General 5 01-18-2003 03:26 PM

All times are GMT -5. The time now is 08:38 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration