- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script Problem
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2007 05:52 AM
02-09-2007 05:52 AM
Script Problem
Here is a copy of the script.
root: /root ==> more genadmin
#!/bin/ksh
# mail lvol list to root
/usr/bin/bdf
# back up lvol config; mail output to root
/etc/vgcfgbackup /dev/vg00
/etc/vgcfgbackup /dev/vg01
#
#
# Check out Swap Space:
swapinfo -tam
#
#
# Check the size of the "mib2agt" program:
ps -efl|grep mib2agt
#
#
# remove old files from ifas tmp directories, /tmpspool
touch /apps/ifas/admin/tmp
touch /apps/ifas/bsi/tmp
touch /apps/testifas/admin/tmp
rm -r `find /apps/ifas/admin/tmp -depth -mtime +1`
rm -r `find /apps/ifas/bsi/tmp -depth -mtime +1`
rm -r `find /apps/testifas/admin/tmp -depth -mtime +1`
touch /tmpspool/.stdlist /tmpspool/err /tmpspool/download /tmpspool/fxpress /tmp
spool/payrpts /tmpspool/payxtracts /tmpspool/workcomp
rm -rf `find /tmpspool -mtime +2`
# clear out the "printutl" folder (used by the printer called "transfer")
touch /home/printutl
rm -rf `find /home/printutl -mtime +2`
# extract the performance data for today
# cd /home/root
# rm rxlog
# fn=`date +%Y%m%d`
# /opt/perf/bin/extract -xt d -gp
# mv rxlog ${fn}.prf
# /opt/contrib/bin/VgCollect > /home/root/kiska.xvg
# deal with syslog
# cd /var/adm
# mv syslog syslog.$fn
# rm -rf `find ./syslog.* -mtime +14`
# kill -HUP `cat /var/run/syslog.pid`
root: /root ==>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2007 06:25 AM
02-09-2007 06:25 AM
Re: Script Problem
The touch command has not changed, I'm afraid the directories don't exist befor the command runs.
You can change this by running the script commands manually.
BTW, I'm not sure that the way you run rm commands is the best. If find commands produce long lists, the script can have problems.
Try to use:
find dirname -mtime +2| xargs rm -f
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2007 06:26 AM
02-09-2007 06:26 AM
Re: Script Problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2007 06:34 AM
02-09-2007 06:34 AM
Re: Script Problem
Also, you should replace your "rm ... find" by something like the following:
find /home/printutl -mtime +2 -exec rm -rf +
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2007 03:09 PM
02-11-2007 03:09 PM
Re: Script Problem
1.Touch command:Touch updates the access, modification, and last-change times of each argument.The file name is created if it does not exist. If no time is specified the current time is used.
So,here i think instead updating its creating files.You can use it with following option:
-c Silently prevent touch from creating the file if it did not previously exist.
Regards,
Reshma