- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: critical files comparison on to different path...
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
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
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
09-05-2014 12:31 AM
09-05-2014 12:31 AM
Re: critical files comparison on to different path & copying
>I want to copy the missing files from first path to second path...i.e file b, d & f ...
rsync will do that.
But if you have empty files or files with different content in the second path, then rsync will make them the same. So if you don't want that or don't want to wasted time copying them files, you need somthing else.
>here is a script that will compare 2 directories ...
You can simplify the logic in the while loop with comm(1):
# Use comm(1) to output all the files in TMP1 that are not in TMP2, both must be sorted
comm -23 ${TMP1} ${TMP2} | while read FILE; do
echo "Copying ${DIR1}/${FILE} to ${DIR2}"
cp -p ${DIR1}/${FILE} ${DIR2}
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2014 09:43 AM
09-05-2014 09:43 AM
Re: critical files comparison on to different path & copying
Are these scripts what you wanted?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-20-2014 01:29 AM
10-20-2014 01:29 AM
Re: critical files comparison on to different path & copying
Hello Experts,
Thanks all for your help....
Much appriciated....
With best regards,
Vishal
- « Previous
-
- 1
- 2
- Next »