- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Transfer problem
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-17-2008 04:04 AM
07-17-2008 04:04 AM
Transfer problem
I have below script to do it , when run it , the file could be transfer to remote server , but can't get it back , it pops "Failed to open file." , it seems can't find the file in remote server , can advise what is the problem ? thx
ftp remote_server<
lcd dir1
passive
cd dir1
put *
lcd dir2
get *
EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 04:13 AM
07-17-2008 04:13 AM
Re: Transfer problem
try mget and mput.
Kenan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 04:28 AM
07-17-2008 04:28 AM
Re: Transfer problem
you are right , it works now , I have a few more questions ,
1. it could get back the file to dir2 now , can advise how to compare the files in dir1 and dir2 , if found any file difference , then send me mail ?
2. do you think is it a good way to check the file transfer successful or not ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 05:04 AM
07-17-2008 05:04 AM
Re: Transfer problem
have a look at diff command. you can write a script using it and mailx command. diff can also compare files so if there has been a problem because of transfer, you'll be aware of it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 05:17 AM
07-17-2008 05:17 AM
Re: Transfer problem
diff is file content comparsion , as this is binary file , I think compare the file existence will do , if any files is not exist in dir2 , then send me alert , can advise how to do it ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 06:58 AM
07-17-2008 06:58 AM
Re: Transfer problem
could advise what can i do ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 07:10 AM
07-17-2008 07:10 AM
Re: Transfer problem
> is binary file , I think compare the file
> existence will do [...]
Why would you think this? Are non-text files
somehow more robust than text files?
> 2. do you think is it a good way to check
> the file transfer successful or not ?
If the FTP server says "2xy", I'd probably
relax and be happy. Or, I'd package the
files using a program like Info-ZIP Zip,
which includes some data integrity info, so
that UnZip will complain if the archive is
corrupt.
The best solution depends on details of the
requirements which you have not supplied.
> could advise what can i do ?
More than you've already been advised? Not
really, not for free. A forum search for
"mailx" should find some scripts which send
e-mail, if that part is still a mystery.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 07:16 AM
07-17-2008 07:16 AM
Re: Transfer problem
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1248225
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 07:45 PM
07-17-2008 07:45 PM
Re: Transfer problem
I wrote it already , but still have problem ,
1. after get back the files , I want to remove all files on remote site , I tried to use del file_name is OK to remove the file , but if I want to remove all files in dir1 on remote site , what can i do ?
2. use diff will compare the file includes file and sub-directory , how can i only compare files ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 08:45 PM
07-17-2008 08:45 PM
Re: Transfer problem
Yes, and your main problem seems to be that
you haven't read "man ftp" or "man diff".
> [...] if I want to remove all files [...]
"man ftp". Remember "mget" and "mput"? Try
"mdelete"?
> [...] diff will compare the file includes
> file and sub-directory [...]
"man diff". As usual, it would help if you
showed the actual command you used, as
different commands can behave differently.
"diff -r" compares directories recursively.
"diff" without "-r" compares two directories
or two files, doesn't it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 09:25 PM
07-17-2008 09:25 PM
Re: Transfer problem
I tried mdelete , it is OK to remove the file in remote site , but still show the below message after run it , can advise what is wrong ? thx
Delete operation failed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2008 11:41 PM
07-17-2008 11:41 PM
Re: Transfer problem
I edited this ftp script , it can put and get the files well ,if I want to add a comparsion script (eg. comparsion_script) to this ftp script , can advise what can i do ? Thx
ftp remote_server<
lcd dir1
passive
cd dir1
put *
lcd dir2
get *
mdelete *
comparsion_script
EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 12:41 AM
07-18-2008 12:41 AM
Re: Transfer problem
what I want is after mdelete the file , then run the comparsion script , if I just add the script name to the ftp script , it will pop "?Invalid command" , can advise what can i do ?ã ï½ ï½ ï½
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 12:42 AM
07-18-2008 12:42 AM
Re: Transfer problem
You may not have permission to remove files on the remote system. Can you manually use "del" on a single file? Can you manually use "mdel" on another single file?
What does "ls -d ." show?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 12:46 AM
07-18-2008 12:46 AM
Re: Transfer problem
To run a script you must exit ftp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 12:54 AM
07-18-2008 12:54 AM
Re: Transfer problem
To run a script you must exit ftp.
if exit ( bye ), how to run its next script ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 01:01 AM
07-18-2008 01:01 AM
Re: Transfer problem
Your current script has:
ftp remote_server<
mdelete *
EOF
You either invoke your "comparsion_script" here or put the compare commands inline.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 03:34 AM
07-18-2008 03:34 AM
Re: Transfer problem
> file in remote site , but still show the
> below message after run it , can advise
> what is wrong ? [...]
Not without some useful information.
> To run a script you must exit ftp.
Not really. It might help if you would read
"man ftp", but I'm beginning to doubt it.
[...]
COMMANDS
[...]
![command [args]]
Invoke a shell on the local host. [...]
Have you considered hiring someone who can do
your job for you?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 05:02 AM
07-18-2008 05:02 AM
Re: Transfer problem
>Not really
Oops, right. But ! would be next to useless at the end of ftp, when you can just exit back to the shell.
And just about the only commands I use are !pwd and !ls. Otherwise when interactive I use control-Z and use a real shell.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 07:39 AM
07-18-2008 07:39 AM
Re: Transfer problem
Rather than comparing the files before and after the transfer, use the sum command to get a checksum.
CSUM1=`sum $FILE|awk '{ print $1 }'`
scp $FILE $DESTHOST:/$DESTDIR
CSUM2=`ssh $DESTHOST sum $DESTDIR/$FILE|awk '{ print $1 }'`
if test "$CSUM1" -ne "$CSUM2"
then
echo "There is a problem with the file transfer."
fi
If you have not yet installed or configured ssh on your systems, I have previously posted instructions on how to to do this.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2008 02:12 PM
07-18-2008 02:12 PM
Re: Transfer problem
sum(1) says: sum is obsolescent ...
So you should use cksum instead.