Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Weird BASH behavior with rm

Status
Not open for further replies.

sostek

MIS
Sep 17, 2004
134
US
Here's my script, it scp's a tar file from a server, then expands and dumps all into one huge file for analysis by awstats. I then try to use rm -f to remove the dirs created and the files created but it doesn't work.

#!/bin/bash

cd /home/statlogs

/usr/local/bin/scp statlogs@director:/home/statlogs/director_access_logs.tar rssonate_web_logs.tar

tar --ungzip -xvpf rssonate_web_logs.tar

cd data1/weblogs/ssw1
cat access_log.* > ../../../alllogs.log
cd ../ssw2
cat access_log.* >> ../../../alllogs.log
cd ../ssw3
cat access_log.* >> ../../../alllogs.log
cd ../ssw4
cat access_log.* >> ../../../alllogs.log


perl /usr/local/apache2/htdocs/awstats/ -config=rssonate -update

rm -f alllogs.log
rm -rf data1


Can anyone give me any hint as to why the delete isn't taking place?
 
what about simply this ?
#!/bin/bash
cd /home/statlogs
/usr/local/bin/scp statlogs@director:/home/statlogs/director_access_logs.tar rssonate_web_logs.tar
tar --ungzip -xvpf rssonate_web_logs.tar
cat data1/weblogs/ssw[1-4]/access_log.* > alllogs.log
perl /usr/local/apache2/htdocs/awstats/ -config=rssonate -update
rm -rf alllogs.log data1

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top