- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- scripts help
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
03-21-2005 05:35 PM
03-21-2005 05:35 PM
scripts help
how to do a simple scripts when the scripts check for the today file based on today date, if exist and size > 0 then perform the processing.
any help is appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2005 06:04 PM
03-21-2005 06:04 PM
Re: scripts help
You can also test if a file exists or not. Example:
if [ -r /etc/rc.config.d/samba ]
then . /etc/rc.config.d/samba
fi
Also you can get the size of a file:
ll | awk '{ print $5 }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2005 06:16 PM
03-21-2005 06:16 PM
Re: scripts help
"find . -ctime 1" lists files that has their status changed
in last 24 hrs. To see file that were modified in last 24
hrs, use "-mtime" instead of ctime.
One key thing is, last 24hr is not necessarily today.
So you might want to get today's date (by using
date command) and search (using grep) for today's
date from the find output. This also handles files
created on same date one or more years back.
- Biswajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2005 06:17 PM
03-21-2005 06:17 PM
Re: scripts help
for file in `find . ! -name . -ctime -1`
do
if [[ $(ls -s $file | awk '{ print $1 }') -gt 0 ]]
then
# operation $file
echo $file
fi
done
HTH.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2005 12:31 PM
03-22-2005 12:31 PM