Automate FTP / Scripting FTP Transfers files from linux to windows m/c
Hi Friends,
I need to transfer file from linux to window m/c through ftp in daily basis. Daily file name change to today's date (e.g fullbackup_yyyymmdd) and previous date's file is deleted. as i m not good in shell scripting. please help me how i can do this. I searched it and got following script - #! /usr/bin/ksh HOST='W.X.Y.Z' USER='XXXX' PASSWD='YYYY' exec 4>&1 ftp -nv >&4 2>&4 |& print -p open $HOST print -p user $USER $PASSWD print -p cd directory print -p binary print -p put ash.txt print -p bye wait exit 0 but still getting error - test_ftp: line 9: print: command not found test_ftp: line 10: print: command not found test_ftp: line 11: print: command not found test_ftp: line 12: print: command not found test_ftp: line 13: print: command not found test_ftp: line 14: print: command not found Also, i m getting this - test_ftp: line 8: syntax error near unexpected token `&' test_ftp: line 8: `ftp -v -n >&4 2>&4 |& ' where there is no space between "|" and "&" Kindly help me. Thanks Ashish |
install a package called "ftp-upload" onto your server and then use this bash script and put in in a cron.
Quote:
|
this issue resolved by this script
#!/bin/bash
HOST='your.ftp.site' USER='remoteusername' PASSWD='remotepasswd' ftp -n -v $HOST << EOT ascii user $USER $PASSWD prompt cd upload ls -la bye EOT |
Something wrong with sftp?
ftp is incredibly insecure. |
Quote:
|
Coffee is required.
Thanks T |
All times are GMT -5. The time now is 09:48 AM. |