- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Copy Ignite images
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
тАО04-14-2009 12:37 AM
тАО04-14-2009 12:37 AM
Copy Ignite images
My scripting skills are rusty from and I need some pointers.
I need a simple shell script that copies my Ignite images to another server and removes the previous Images before the copy operation starts.
Any help appreciated.
Francis
- Tags:
- ignite
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 01:24 AM
тАО04-14-2009 01:24 AM
Re: Copy Ignite images
#!/usr/bin/ksh
rm IgniteServer_IP:/path_to_ignite/2009*
I want to copy only the most recent image (created within 48hrs) since i keep the last two ignites. How would I use the find command to select this?
Something like this perhaps?
find . -type f -mtime 2 -exec cp....
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 02:00 AM
тАО04-14-2009 02:00 AM
Re: Copy Ignite images
>find . -type f -mtime 2 -exec cp
You would use: -mtime -2
-mtime 2 is for 2 to 3 days.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 02:20 AM
тАО04-14-2009 02:20 AM
Re: Copy Ignite images
Could you complete this last line to copy the file?
Something like this perhaps:
find . -type f -mtime 2 -exec cp {} /ignite/source_image destination_IP:/dir/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 02:31 AM
тАО04-14-2009 02:31 AM
Re: Copy Ignite images
-n number_archives
Specifies the number of archives that should remain on the server at any given time. The default is two (2)
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 02:37 AM
тАО04-14-2009 02:37 AM
Re: Copy Ignite images
find . -type f -mtime 2 -exec rcp {} destination_IP:/dir/ +
I'm not sure -exec will work and you may have to write a script:
#!/usr/bin/ksh
rcp $* destination_IP:/dir/
With a script, you can also remove the files after copying them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 02:50 AM
тАО04-14-2009 02:50 AM
Re: Copy Ignite images
>>find . -type f -mtime 2 -exec cp {} /ignite/source_image destination_IP:/dir/
1) . will search your file from root directiory insted of . you can give your source path /ignite or where your file is resaiding.
2) cp will not copy your file one server to other in this case you have to use scp or rcp to copy your file into another server.
find /opt/ignite/ -type f -mtime 2 -exec rcp destination_IP:/dir ()\;
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 04:14 AM
тАО04-14-2009 04:14 AM
Re: Copy Ignite images
find /var/srcdir/ -type f -mtime 2 -exec rcp dest_ip:/var {}\;
find /var/srcdir/ -type f -mtime 2 -exec rcp {} dest_ip:/var \;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 04:21 AM
тАО04-14-2009 04:21 AM
Re: Copy Ignite images
> I've tried both of these and they execute without errors but no files are copied.
find /var/srcdir/ -type f -mtime 2 -exec rcp dest_ip:/var {}\;
find /var/srcdir/ -type f -mtime 2 -exec rcp {} dest_ip:/var \;
What happens if you simply do:
# find /var/srcdir/ -type f -mtime 2 -print
...do you in fact, get any output? Using an unsigned argument to '-mtime' means _EXACTLY_ two (2) in this case. You probably want to use:
# find /var/srcdir/ -type f -mtime +2 ...
As Dennis noted, making the '-exec' argument a script that does the copy and then on success _removes_ the copied file is probably the desired approach.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-14-2009 04:36 AM
тАО04-14-2009 04:36 AM
Re: Copy Ignite images
Exactly 2 days means: 2 <= X < 3 days
Anywhere from 48 to one second less than 72 hours. With -2 and +2 on each of the two sides. Unless you use UNIX95=FIDDLE_WITH_FIND_TIMES:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1306285
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1271016