- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- 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
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2009 05:25 AM
04-14-2009 05:25 AM
Re: Copy Ignite images
> Dennis: Exactly 2 days means: 2 <= X < 3 days
Yes, that's true and probably expressed better than the manpages for 'find' discuss the n, -n and +n arguments. My point, however, was that Francis may be not have realized that using 'n' alone might too strictly restrict his expectations.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2009 05:44 AM
04-14-2009 05:44 AM
Re: Copy Ignite images
It is expressed better because the manpage is broken and documents the UNIX95=FIDDLE_WITH_FIND_TIMES option, not the default.
>My point was that Francis may be not have realized that using 'n' alone might too strictly restrict his expectations.
Yes, I already mentioned that, so I assumed that wasn't your point.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2009 05:58 AM
04-14-2009 05:58 AM
Re: Copy Ignite images
> Dennis: It is expressed better because the manpage is broken and documents the UNIX95=FIDDLE_WITH_FIND_TIMES option, not the default.
OK, then how about getting the 'find()' manpages improved? You have been able to jump-start issues like this before :-)
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2009 06:16 AM
04-14-2009 06:16 AM
Re: Copy Ignite images
(I hadn't heard of minus values for -mtime before)
Adding the -exec rcp part at the end and is coming back with
find /var/srcdir/ -type f -mtime -2 -exec rcp dest_ip:/dir {} \;
remshd: Couldn't look up address for your host
remshd: Login incorrect.
The hosts files on both servers are correct and they resolve just fine.
inetd.
inetd.conf has
kshell stream tcp6 nowait root /usr/lbin/remshd remshd -K
klogin stream tcp6 nowait root /usr/lbin/rlogind rlogind -K
Do I need .rhosts and hosts.equiv files to use rcp?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2009 06:26 AM
04-14-2009 06:26 AM
Re: Copy Ignite images
You ask: Do I need .rhosts and hosts.equiv files to use rcp?
These files may need to be changed if the name resolution environment is different at restore time.
I find it easier to move these files around as tar files personally. You could still use the find commands to pick and build the tar files.
I found rcp sometimes introduced errors which compromise the integrity of the ignite backups.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2009 06:29 AM
04-14-2009 06:29 AM
Re: Copy Ignite images
> Do I need .rhosts and hosts.equiv files to use rcp?
Yes, see the manpages for 'rcp'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2009 04:00 PM
04-14-2009 04:00 PM
Re: Copy Ignite images
If you looked at threadId=1271016, you'll see you already thanked me for that. :-)