- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- remote copy.
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
07-10-2002 04:12 PM
07-10-2002 04:12 PM
This is a strange requirement and i am not sure there is a workaround? I need to copy a file from hostA to hostB on a regular basis(probably a cron job). But i should not do the following..
1. No rcp
2. No ftp as it would require a password.
3. The cron job even if run should not be run as root.
Any ideas folks, Please help me here,
Thanks & Regards
Joe.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 04:23 PM
07-10-2002 04:23 PM
Re: remote copy.
1) using NFS and run copy(through cronjob)
as a non-root user
(2) Using CIFS/9000 and run copy(through cronjob) as a non-root user
3) using scp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 04:27 PM
07-10-2002 04:27 PM
Re: remote copy.
Thanks for the quick reply, but scp would require a password is it not? The whole thing needs to be coded so that the cron would copy files as and when it finds new copy. we are running 11.0. Any ideas?
Thanks
Joe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 04:37 PM
07-10-2002 04:37 PM
Re: remote copy.
scp wouldn't require a password, if you use public key authentication with an unencrypted key (note -- this has potential, serious security implications if someone other than the owner of the key can read it).
Exact procedure depends on which implimentation of ssh you are using, but the command to feed cron would be the same:
scp user@hostb filename.on.hosta
hth
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 06:23 PM
07-10-2002 06:23 PM
Re: remote copy.
This would be a fairly straightforward bit of Perl.
Plan B:
If you were to allow anonymous ftp then you can do this very easily using the Perl Net::FTP module.
Plan C: A C version of Plan A; Perl's easier and just about as fast.
The Perl options are also platform independent and could even work in a Windows/UNIX environment without changes.
Food for thought, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2002 11:33 PM
07-10-2002 11:33 PM
Re: remote copy.
think about it.
http://rsync.samba.org/README.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 01:51 AM
07-11-2002 01:51 AM
Re: remote copy.
Other idea: Mail the file (if needed to a non-human 'user') and let the receiving side handle it, either (partially) 'manually', or fully automatic via .forward (and procmail if needed).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 06:21 AM
07-11-2002 06:21 AM
Re: remote copy.
Thanks. I am Impressed with Clay's solution but not sure how to execute it. I have no knowledge of rsync(but is it not another "r" commands that puts off the security guys). About mailing idea, how would you set it up for a non-human user with a .forward??
You help would be appreciated.
Thanks
Joe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 06:30 AM
07-11-2002 06:30 AM
Re: remote copy.
Have you checked the "rdist" command. I think it serves some purpose like that, but have not really used it myself, so i'm not sure.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 06:37 AM
07-11-2002 06:37 AM
Re: remote copy.
Thanks. So doesn't it require a password?
Joe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 07:03 AM
07-11-2002 07:03 AM
Re: remote copy.
I normally use procmail in .forward, but I think you can just put this in .forward (*including* the outer quotes):
"|IFS=' '&&exec /path/to/your/script"
[The space between the single quotes is just that, a space, i.e. not a tab.]
The script can read the mail from its standard input and can do anything it likes with it.
Note: You may have to tweak the sendmail configuration to allow executables in .forward files. I will leave that part to others, because, for mail, I am a user. not an admin.]
Note 2: Instead of .forward you can set up an alias (see aliases(5M)) for the non-human user. I will leave that part also to others, for the same reason.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 07:09 AM
07-11-2002 07:09 AM
Re: remote copy.
Can you explain
"|IFS=' '&&exec /path/to/your/script"
and what is procmail?? is it on by default?
Thanks
Joe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 07:24 AM
07-11-2002 07:24 AM
Re: remote copy.
My understanding in using rdist is that it works in the same manner as rcp, does not need a passowrd but does need a $HOME/.rhosts configured or /etc/hosts.equiv configured. Here is a link which could be of some help.
http://support2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=500000000092407
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 07:41 AM
07-11-2002 07:41 AM
Re: remote copy.
procmail, 'process mail', is a program which can handle incoming mail. It has a commandfile, .procmailrc, which contains 'recipes' which tell procmail what to do with each type of mail, subject, address, etc., etc.. It can do quite a lot, but is probably not needed in your case. procmail is not included in HP-UX, but is freely available.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 08:52 AM
07-11-2002 08:52 AM
Re: remote copy.
Well rdist.. if it has to use rhosts file then we may use rcp. Any advantages of rdist over rcp??
Thanks
Joe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 09:09 AM
07-11-2002 09:09 AM
Re: remote copy.
There are a host of good ideas in this thread.
I guess it is a matter of preference.
In our shop that seems to be ftp.
We have countless automated ftp scripts that put and get files.
No intervention, secure passwords, error checking with automated emails on failures, etc., etc.
Go for whatever your shop is comfortable with.
Regards,
dl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 10:20 AM
07-11-2002 10:20 AM
Re: remote copy.
Are you using ftp with .netrc. Can you send me the procedure if possible.
Thanks
Joe.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 10:50 AM
07-11-2002 10:50 AM
Re: remote copy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2002 12:12 PM
07-11-2002 12:12 PM
Solutionsample .netrc file to be in the root directory of the user:
# 05/25/01 dlamar Created for automated ftp
machine minga login wxyz password abcdef
*********************************
In the above wxyz is the login name on the remote machine and abcdef is the password. Make the permissions on your .netrc readable by only users/groups you desire.
Sample ftp script:
# 07/24/01 dlamar Created for unix to vse ftp
ftp -v esa2 << endl >> /home/dlamar/work/ftp.log
prompt
ascii
put /home/dlamar/work/testunix
quit
endl
tail -14 /home/dlamar/work/ftp.log | mailx -s "FTP listing results" someone@companyname.com
***************************************
In the above, following the prompt line you can insert any cd command you need.
The log file created can be scannned for errors and email sent as desired.
i.e.
grep 'Not connected' $FTP_LOG 1>/dev/null 2>/dev/null
echo $? | read RC
grep 'full' $FTP_LOG 1>/dev/null 2>/dev/null
echo $? | read RC1
grep 'fail' $FTP_LOG 1>/dev/null 2>/dev/null
echo $? | read RC2
echo "The RC value is $RC" > $SCRIPT_HOME/messages
echo "The RC1 value is $RC1" >> $SCRIPT_HOME/messages
echo "The RC2 value is $RC2" >> $SCRIPT_HOME/messages
if [ $RC -lt 1 -o $RC1 -lt 1 -o $RC2 -lt 1 ]
then
tail -5 $FTP_LOG > $SCRIPT_HOME/messages
mailx -s "FTP failed for $SCRIPT_HOME" someone@companyname.com < $FTP_LOG
exit
else
fi
Like I said, you can manipulate the script as desired and schedule in cron or call from another script, etc., etc.
Used extensively in our shop both internally and to outside sources/vendors servers.
Best of luck.
dl