LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices



Reply
 
Search this Thread
Old 06-04-2005, 08:16 PM   #1
Soulful93
Member
 
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.

Code:
#!/bin/bash
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
cd
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, 08:26 PM   #2
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96
Hi.

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

Dave
 
  


Reply


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 05:25 PM
Simple Bash Script Help njdownes Programming 2 03-05-2005 08:35 AM
Simple Bash Script dmedici Programming 9 12-31-2004 04:48 AM
Help with simple bash script - please tw001_tw Linux - Software 5 12-19-2004 10:02 PM
Simple BASH script fio Linux - General 5 01-18-2003 04:26 PM


All times are GMT -5. The time now is 10:49 AM.

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