Re: Maintenance Scripts

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would and the file type option in the find command
so it would not remove a directory by mistake. I would
also have it delete any "core" files unless you use
them for debug purposes.


--- Thom Paine <admin@xxxxxxxxxxxxxxxxx> wrote:
> I have been playing with maintenance scripts and
> would like a hand with
> making a nightly one.
> 
> Basically I would like a report of the hard drives
> free space, a report
> of a nightly virus scan, have it delete any temp
> files, and that sort of
> thing. I've been thinking on getting it to email me
> a complete report
> after it is finished up, and I'm not sure how to tie
> it all together.
> 
> What I have so far is this.
> 
> #!/bin/bash
>                                                     
>                            
> # Maintenance Script
>                                                     
>                            
> # Find and delete temp files
> cd /home
> find -name *.tmp -exec rm -f {} \;
> find -name *.TMP -exec rm -f {} \;
> find -name *.bak -exec rm -f {} \;
>                                                     
>                            
> # Report each users home folder size
>                                                     
>                            
> cd /home
> du -c -h --max-depth=1 > /root/homesize.txt
>                                                     
>                            
> # Disk Free List
> df -h > /root/diskfree.txt
> 
> 
> Any comments or help would be appreciated. I'm a
> script rookie and am
> working away at it slowly.
> 
> Thanks.
> 
> -=/>Thom
> 
> 
> 
> -- 
> Shrike-list mailing list
> Shrike-list@xxxxxxxxxx
> https://www.redhat.com/mailman/listinfo/shrike-list


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux