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
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
04-17-2007 08:30 PM
04-17-2007 08:30 PM
I am looking for a script or command to find out if any of the files in a given directory have been changed/modified/deleted/added (since the previous run).
All help is appreciated.
Thank you.
Kind regards,
Luc Monnens
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 08:51 PM
04-17-2007 08:51 PM
Re: script
I suggest to collect a checksum of all directory entires and compare these results:
chkdir=my/direc/tory
cd chkdir
ls -a | xargs cksum | sort >/tmp/base${chkdir##*/}.cksum
For later comparisions:
...
ls -a | xargs cksum | sort >/tmp/new${chkdir##*/}.cksum
comm -3 /tmp/base${chkdir##*/}.cksum /tmp/new${chkdir##*/}.cksum
Look at the man pages of 'cksum' and 'comm' for further information. The analysis of the output of the comm command is left as an exercise ....
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 09:35 PM
04-17-2007 09:35 PM
Re: script
cd /directory
ll -tr > /tmp/inventory.18042007
tomorrow:
cd /directory
ll -tr > /tmp/inventory.19042007
diff /tmp/inventory.18042007 /tmp/inventory.19042007
NB - there is no line break in the diff command - it merely shows that way in this box.
Mark Syder (like the drink but spelt different)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2007 11:12 PM
04-17-2007 11:12 PM
Re: script
Next to find changed files just use find:
# find ${RUNDIR} -newer last-run
This might not be good enough as it could find files for which the date was change but the data not. And it might not find files for which the contents was changed, but the date reset to fall before the last-run.
I consider both a good feature for most production environments.
But for 'secure' environments you may prefer a checksum mechanism as outlined before as it is 99.99% certain to catch file content modifications.
fwiw,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2007 12:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2007 10:02 PM
04-19-2007 10:02 PM
Re: script
Because of that the others were not really valued on their merrits.
Thank you all for your input.
Much appreciated.
Kind regards,
Luc