Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
If you comment out the part where the script is run do you still not see the echo lines? That doesn't look like the full script. Can you copy and paste the whole thing.
##!/bin/sh
rm -f ~/daily_process # delete previous day file
touch ~/daily_process # housekeeping to setup file
echo ">>> daily process /odin for `date`" >> ~/daily_process ; echo ""
echo '' >> ~/daily_process
echo '*** Update Virus file ' >> ~/daily_process
/usr/local/bin/vsupdate >> ~/daily_process # Update file that wscanall uses to scan for viruses
echo '' >> ~/daily_process
echo '*** Scan entire system for viruses ' >> ~/daily_process
/usr/local/bin/scanall >> ~/daily_process # Scan All filesystems for viruses
echo '' >> ~/daily_process
echo '*** Disk Statistics *** ' >> ~/daily_process
echo '' >> ~/daily_process
echo '*** disk space usage *** ' >> ~/daily_process
df -h >> ~/daily_process # disk space usage snapshot
echo '' >> ~/daily_process
echo '*** disk inode usage *** ' >> ~/daily_process
df -ih >> ~/daily_process # disk inode statistic snapshot
#tail -16 /opt/uagent/logs/uag.log >> ~/daily_process # most recent backup data (may have to a adjust if add more filesystems)
# clears the /tmp directory of all files and directories older than 10 days. Good general housekeeping. jlh
echo "" >> ~/daily_process # blank spacer
echo '*** /tmp file prior to housekeeping' >> ~/daily_process
ls -l /tmp >> ~/daily_process
touch /tmp/lost+found #need to keep lost+found in /tmp for recovery purposes
find /tmp -mtime +10 -type f -exec rm -Rv {} \; # remove files older than 10 days
find /tmp -mtime +10 -type d -exec rm -Rv {} \; # remove directories older than 10 days
echo '' >> ~/daily_process # blank spacer
echo '*** /tmp file after housekeeping' >> ~/daily_process
ls -l /tmp >> ~/daily_process
echo '' >> ~/daily_process # blank spacer
echo '*** chkconfig checkup ' >> ~/daily_process
chkconfig --list >> ~/daily_process
echo '' >> ~/daily_process # blank spacer
This is just a routine I use to do manually. I put it all in this little script and direct to a file and then just email me the file in the morning. Cron submits the job. I cannot get the #!/bin/sh to work... gives me : bad interpreter: No such file or directory when I uncomment that line.
This script runs without any problem on RH7.3.
I figured it out from reading RH website post.
It appeas that since I ftp'd this script from one box to the new, the linefeed got messed up as a DOS linefeed. I just copied and pasted each line to a new script. That worked. The post mentioned using dos2unix or td -d '\r' <script> script.new. I could not get that to work.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.