How can I make a script to ftp over?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How can I make a script to ftp over?
# 1  
Old 02-26-2009
Power How can I make a script to ftp over?

Hi,
I have a script that ftp over the file:

CFGFILE=/export/home/myuser/scripts/ftp1.cfg
LOGFILE=/app/bea/logs/
LOCALPATH=/expport/home/myuser/ECNLogs/

YEAR=`date '+%Y'`
MONTH=`date '+%m'`
DAY=`date '+%d'`
HOUR=`date '+%H'`
MINUTE=`date '+%M'`
LASTHOUR=$((HOUR-1))
echo $LASTHOUR


find /app/bea/logs/xxx.log.$YEAR-$MONTH-$DAY-0$LASTHOUR -type f -exec cp {} /export/home/myuser/ECNLogs/xxx.log-f.$YEAR-$MONTH-$DAY-$LASTHOUR \;
gzip /export/home/myuser/ECNLogs/*
$NCFTPPUT -V -f $CFGFILE -c 10.10.10.10/ECNLogs/xxx*

Everythings works except ftp the file! Help?
# 2  
Old 02-26-2009
Where do you set the $NCFTPPUT variable, what value does it hold, and does the executable exist?
# 3  
Old 02-26-2009
Maybe a here-script like this is an alternative for you:

Code:
ftp -vn 10.10.10.10 << EOF
   user karl secretpassword
   bin
   prompt
   mput /export/home/myuser/ECNLogs/xxx*
   bye
EOF

To make it more secure, use scp or sftp instead of ftp.
# 4  
Old 02-26-2009
Quote:
Originally Posted by pludi
Where do you set the $NCFTPPUT variable, what value does it hold, and does the executable exist?
NCFTPPUT=/opt/ncftp/bin/ncftpput
# 5  
Old 02-26-2009
Quote:
Originally Posted by zaxxon
Maybe a here-script like this is an alternative for you:

Code:
ftp -vn 10.10.10.10 << EOF
   user karl secretpassword
   bin
   prompt
   mput /export/home/myuser/ECNLogs/xxx*
   bye
EOF

To make it more secure, use scp or sftp instead of ftp.
You are cool, it works fine, tnx alot Smilie

Mehrdad
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

To make an ftp server writable

I want to implement an FTP server on RHEL 5.8 system where the users can upload files either from RHEL or Windows systems but am not able to copy files to it from a browser session. For eg. URL - ftp://10.101.17.80/incoming I want to copy files from to it from my Windows... (3 Replies)
Discussion started by: RHCE
3 Replies

2. Shell Programming and Scripting

want to make same machine as ftp

Hi, I have been acces to unix box , I HAVE BEEN ALLOTED A URL AND USERID ALONG WITH PASSWORD ,and thru putty i acess to that unix machine ...Now I want same machine to be used as ftp server can I do that...?actually no seprate ftp server acess is given to me and now i want to test some ftp... (1 Reply)
Discussion started by: rahul125
1 Replies

3. Shell Programming and Scripting

how to run script? call other script? su to another user? make a cron?

Good morning. I am searching for "how-to"'s for some particular questions: 1. How to write a script in HP-UX 11. 2. How to schedule a script. 3. How to "call" scripts from the original script. 4. How to su to another user from within a script. This is the basics of what the... (15 Replies)
Discussion started by: instant000
15 Replies

4. Shell Programming and Scripting

how i can make one ip access to ftp account and deny others

HI I want to make only one IP can access to ftp acount in cpanel or by shell can any body help me ? (1 Reply)
Discussion started by: elkadrey
1 Replies

5. Shell Programming and Scripting

Automated FTP script using .netrc to multiple FTP servers

Hi all, I'm using the following script to automated ftp files to 1 ftp servers host=192.168.0.1 /usr/bin/ftp -vi >> $bkplog 2>&1 <<ftp open $host bin cd ${directory} put $files quit ftp and the .netrc file contain machine 192.168.0.1 login abc... (4 Replies)
Discussion started by: varu0612
4 Replies

6. Shell Programming and Scripting

passing parameter to ftp script from output of another ftp

Hi, I have a ftp script which first gets all the file names and echo's the latest file. I'm using another ftp command sets to get the file name given by first ftp. The problem is the parameter is not accepted by second ftp. The error message i'm getting is > Rename Temp File calloc:ICMP... (5 Replies)
Discussion started by: ammu
5 Replies

7. Solaris

To make ftp an sftp?

Hi All, I want to make ftp for a particular server(ip ,user/passwd) sftp . Regards Megh (2 Replies)
Discussion started by: megh
2 Replies

8. Shell Programming and Scripting

ftp script not able to connect to ftp server.

I have the following ftp script to get files from a remote location. However, on running the script I find that I am not even able to connect to ftp server. I am able to connect to ftp server using other GUI ftp tools like WS_FTP using the same IP. IP used here is a dummy IP. What can go... (3 Replies)
Discussion started by: gram77
3 Replies

9. Shell Programming and Scripting

FTP script to FTP file to UNIX - Solaris

Hello, A couple of times per week, i receive emails notifications when files are available for processing. Currently i read these eamails with a java program and store the attachement on my C: drive and would now like to generate a PC script to send this file name up to UNIX-Solaris and... (3 Replies)
Discussion started by: bobk544
3 Replies

10. Programming

make script

I need to write a make script to install a C module in a UNIX environment.It should install the sources, build the libraries and install them and also install the info pages on the system. Can this script be general enough to also install on windows, windows dll, windows help file's etc. Any... (3 Replies)
Discussion started by: cherio
3 Replies
Login or Register to Ask a Question