- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Microsoft
- >
- Re: DOS + FTP
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
тАО01-27-2009 08:52 AM
тАО01-27-2009 08:52 AM
Does anyone know how to write a script which will connect to an FTP server automatically to put a file (backup)?
I was trying ftp user1@xxx.com but it didn't work.
Regards
Peter
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2009 09:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2009 09:09 AM
тАО01-27-2009 09:09 AM
Re: DOS + FTP
ftp -in -s:FileName xxx.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2009 09:42 AM
тАО01-27-2009 09:42 AM
Re: DOS + FTP
C:\>ftp -in -s:ftp.bat myhost.com
BATCH FILE:
user itsme itsmypsswd
cd C:/
binary
put file.txt
RESULT:
C:\>binary
'binary' is not recognized as an internal or external command,
operable program or batch file.
C:\>put file.txt
'put' is not recognized as an internal or external command,
operable program or batch file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2009 09:43 AM
тАО01-27-2009 09:43 AM
Re: DOS + FTP
I would suggest that you not implement your script with a login/password in the script itself, but rather use the '.netrc' file if you _must_ use FTP.
http://forums13.itrc.hp.com/service/forums/questionanswer.do?admit=109447627+1233077838233+28353475&threadId=231288
Better yet, use SFTP (Secure FTP) and public keys.
# cat .mysftp
HOST=$1
FILE=$2
sftp -b - <
cd /tmp
put -P ${FILE} ${FILE}.backup
EOF
RC=$?
print -u2 "\nSFTP returned ${RC}"
exit
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-27-2009 10:35 AM
тАО01-27-2009 10:35 AM
Re: DOS + FTP
But anyway, I would like to understand what is wrong with my post. Here is a little example from a Windows XP workstation :
C:\TEMP>cat CMDFILE
user anonymous me@hp.com
dir superseded_patches
cd superseded_patches
lcd C:\temp
binary
get catalog
bye
C:\TEMP>ftp -in -s:CMDFILE ftp.itrc.hp.com
Connect├Г┬й ├Г ftp.itrc.hp.com.
220-
220-Welcome to the IT Resource Center ftp server
220-------------------------------------------------------
220-
220-You are user 9, and there is a limit of 2000 simultaneous accesses.
220-
220-Log in as user "anonymous" (using your e-mail address as your password)
220-to retrieve available patches for HP-UX, OpenVMS, True64, MPE/iX, and
220-other platforms.
220-
220-If you are a user of other HP ITRC services, log in with your
220-HP ITRC User ID and password to retrieve your files.
220-
220-
220 g1u1296 FTP server (HP ASL ftpd, version(434)) ready.
ftp> user anonymous me@hp.com
331 Guest login ok, send your complete e-mail address as password.
230 Guest login ok, access restrictions apply.
ftp> dir superseded_patches
200 PORT command successful.
150 Opening ASCII mode data connection for /bin/ls.
total 2302
drwxr-xr-x 7 21164 12753 1024 Jul 2 2003 .
drwxr-xr-x 21 2 2 1024 Oct 29 21:33 ..
-rw-r--r-- 1 21164 12753 1174127 May 15 2002 catalog
drwxr-xr-x 3 21164 12753 96 Mar 30 2006 firmware_patches
drwxr-xr-x 4 21164 12753 96 Jan 26 01:11 hp-ux_patches
drwxr-xr-x 6 21164 12753 1024 Dec 4 09:51 mpe-ix_patches
drwxr-xr-x 32 21164 12753 1024 Jan 25 05:57 mv_patches
drwxr-xr-x 2 21164 12753 96 Jul 2 2003 tru64_patches
226 Transfer complete.
ftp : 568 octets re├Г┬зus en 0,03 secondes ├Г 18,32 Ko/sec.
ftp> cd superseded_patches
250 CWD command successful.
ftp> lcd C:\temp
Dossier local maintenant C:\Temp.
ftp> binary
200 Type set to I.
ftp> get catalog
200 PORT command successful.
150 Opening BINARY mode data connection for catalog (1174127 bytes).
226 Transfer complete.
ftp : 1174127 octets re├Г┬зus en 13,36 secondes ├Г 87,88 Ko/sec.
ftp> bye
221 Goodbye.
As you can see, it works well. When you said "DOS" in the title of your thread, I have assumed "a cmd box from windows". On which version are you working from ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2009 01:02 PM
тАО01-28-2009 01:02 PM
Re: DOS + FTP
How to exclude one directory: /mount
from this backup?
find . -depth -print | cpio -ocv | gzip > /backup/backup.cgz
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-28-2009 01:03 PM
тАО01-28-2009 01:03 PM