- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Automated FTP - help
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
03-15-2006 08:55 AM
03-15-2006 08:55 AM
I have a requirement to schedule an automated ftp from UNIX server to WINDOWS server. Only the files which are created today needs to be pushed to the windows server (ie: according to the timestamp).
Not sure as how this can be implemented in a script. I was aware that automated FTP can be done by creating a .netrc file under the home directory.
Thanks in advance
S.Jagadesh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 08:59 AM
03-15-2006 08:59 AM
Re: Automated FTP - help
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=453848
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 09:03 AM
03-15-2006 09:03 AM
Re: Automated FTP - help
ftpput.pl -h remotehost -l cstephen -p topsecret -A -d /xxx/yyy myfile1 myfile2
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "Transfer ok"
else
echo "Transfer failed; status ${STAT}" >&2
fi
This will login to remotehost as user cstephen, password topsecret, cd to /xxx/yyy, set ASCII mode (-A; -B = binary); and then put myfile1 and myfile2.
Invoke as ftpput.pl -u for full usage. If a .netrc file is found the password argument is not needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 09:07 AM
03-15-2006 09:07 AM
Re: Automated FTP - help
Invoke as ftpget.pl -u for full usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 09:13 AM
03-15-2006 09:13 AM
Re: Automated FTP - help
Thanks for your valuable sugessions.
I am much worried about the time stamp. As i need to ftp the files (created on daily basis only) from unix to windows server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 09:21 AM
03-15-2006 09:21 AM
Re: Automated FTP - help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 04:30 PM
03-15-2006 04:30 PM
Re: Automated FTP - help
a) Using .netrc file.
Refer netrc man page
b) ftp -in
user
...
...
bye
EOF
c) Using expert scripting - to get security on password.
a and b methods are using password in plain text method.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 05:43 PM
03-15-2006 05:43 PM
Re: Automated FTP - help
You can check this:
###############################
#!/usr/bin/sh
DATE=`your date format` #Ex: `date +%m%d%y `
sourcefile="filename.${DATE}"
sourcedir="/filesystem/somedir//"
cd $sourcedir
ftp -n IP_ADDRESS_OF_WIN_SERVER << EOF
user USER PASSWORD
cd "C:\win2k\filesave\"
put $sourcefile
bye
EOF
##############################
Cheers,
Raj.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 08:42 PM
03-15-2006 08:42 PM
Solutionyou can use this:
#!/usr/bin/ksh
cd
touch -t $(date +%y%m%d0000) timestamp
{
echo "ftp -inv
echo "ascii"
for File_name in $(find . -type f -newer timestamp)
do
echo "put $File_name"
done
echo "quit"
echo "END_OF_FTP"
}>ftpx
./ftpx >ftp.log 2>&1
rm timestamp
rm ftpx
instead of
This script will create another script ftpx whcih will contain all teh comamnd to ftp file created today.
HTH,
Art