- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Modify a script to work on bash shell rather t...
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
Discussions
Discussions
Forums
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
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
тАО11-14-2012 12:01 AM
тАО11-14-2012 12:01 AM
Re: Modify a script to work on bash shell rather than ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2012 12:04 AM
тАО11-14-2012 12:04 AM
Re: Modify a script to work on bash shell rather than ksh
Now its working I have used the following:
echo "$dir $(find $dir -type f |wc -l)"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2012 12:32 AM
тАО11-14-2012 12:32 AM
Re: Modify a script to work on bash shell rather than ksh
>du returns: single digit numbers
As I said, du(1) returns a line for every arg and subdirectory.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2012 12:47 AM
тАО11-14-2012 12:47 AM
Re: Modify a script to work on bash shell rather than ksh
its now working fine, I put in the cron to run every hour, but I what I would like now is to insert those figures in some king database or spreadsheet, to make statiscs on hourly and daily basis.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2012 01:07 AM
тАО11-14-2012 01:07 AM
Re: Modify a script to work on bash shell rather than ksh
>is to insert those figures in some kind database or spreadsheet, to make statistics on hourly and daily basis.
Well, you could create a CSV by inserting a "," between the name and count.
You probably also want to add a simple timestamp as another field:
echo "$(date +"%Y-%m-%d:%H:%M") ..."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2012 01:39 AM
тАО11-14-2012 01:39 AM
Re: Modify a script to work on bash shell rather than ksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2012 02:26 AM
тАО11-14-2012 02:26 AM
Re: Modify a script to work on bash shell rather than ksh
>I am not quite sure how to create a csv on that line,
Add a title line before your for-loop
echo "Date,Directory,File_count"
Then in the loop:
echo "$(date +"%Y-%m-%d:%H:%M"),$dir,$(find $dir -type d | wc -l)"
- « Previous
-
- 1
- 2
- Next »