03-07-2008
FTP process
#!/bin/ksh
dir=/dummy
v_data=emp
# 192.0.0.99 is ftp server IP address
# log file will be created as emp.log
# mget to get the files from ftp server
# mdel to delete files from ftp server
# grem all
ftp_data()
{
echo "$1"
# create log file
exec 1>>$dir/$1.log 2>&1
echo "\ncd $FGET"
cd $FGET
time ftp -niv 192.0.0.99 << EOF
user dummy dummy
cd dummy/details
ascii
mget $1*.txt
ls -l
mdel $1*.txt
quit
EOF
}
ftp_data "$v_data"
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
HI
I want to create a date folder and then a log file under it, which will hold all output of shell script. Say shell script abc.sh runs every day and I want to redirect the output of abc.sh > /opt/bea/wls81/Pkmtest/$(date +%Y%m%d)/ant.log.
Here date should always change according to system... (2 Replies)
Discussion started by: pankajkrmishra
2 Replies
2. UNIX for Dummies Questions & Answers
Cameron,
I have deleted the cron log file and create a new cron log file as the older was sucking up the disk space. now i have rescheduled the cron job but i dont see any logs on the newly created log file. I am confused what has happened. Can u help me out on this. (0 Replies)
Discussion started by: sanei05
0 Replies
3. Shell Programming and Scripting
Hi all..
The following set of statements is used in a shell script to ftp a file to a remote machine
I want to redirect the ftp messages thrown by the first ftp statement to a log file. As you can see there is a logic downstream to decide if the ftp was a success or not. But i am not... (5 Replies)
Discussion started by: hareeshkumaru
5 Replies
4. Shell Programming and Scripting
Hi,
I need to create a script that checks if a file exists on an offsite server
which only has ftp enabled. I was originally going to use perls Net::FTP
class but the client does not have perl installed nor wants it.
So, I have to use a shell script which logs into the server, then ... (1 Reply)
Discussion started by: gseyforth
1 Replies
5. Shell Programming and Scripting
Hi Guys
I did a forum search for "ftp scripts" Looked at 8 pages and didnt see anything that would help. Most seem to be logging into a ftp server and transfering files.
What I need to do is login to a FTP server. Goto a folder and list it so it showes newest files first. It would be nice to... (4 Replies)
Discussion started by: voorhees1979
4 Replies
6. Solaris
Hi,
some logs are not getting created under the required folder, which was working fine when i saw last time(15days back). Thought may be some issue with syslog deamon and did lot of R&D. Still not able to fix the bug.:wall: Is there any one to help me out ? Quick response will be appreciated.... (6 Replies)
Discussion started by: Sricharan21
6 Replies
7. Shell Programming and Scripting
Hello,
I need help to check content of ftp log files. I forgot to say that I am on Solaris 9. I am using KSH.
I have 2 log files.
Here is an example of content :
LOG File from 21 October
-rw-rw-r-- 1 cvbntr xarf 94974 Nov 1 2009 TAG__SC___2006175_0.TAB
-rw-rw-r-- 1 cvbntr ... (3 Replies)
Discussion started by: Aswex
3 Replies
8. Shell Programming and Scripting
Hi
I have unix script which does execute some OS commands and DB Commands. I would like to create log file for each command execution, Could some one advise how do we create log file.
Example Script:###########################################################################... (1 Reply)
Discussion started by: cnrj
1 Replies
9. UNIX for Dummies Questions & Answers
Hello :)
This is my first post here.
I am using MKS Toolkit for ksh and awk programming.
The lines that are executed in ksh are shown with a '+' and the values are also shown in the console window.
In case of awk, the interpretation/execution of every line is not available.
Can you please... (2 Replies)
Discussion started by: Naveen_Hinduja
2 Replies
10. Programming
hi all,
created a bash script to create an ftp account, its here -
#!/bin/bash
dir=/mnt/sftp
group=sftp_users
echo "Enter UserName:"
read user
if id $user ; then
echo "$user already exists as you can see above, please re-run the script"
exit
... (6 Replies)
Discussion started by: robertkwild
6 Replies
LEARN ABOUT CENTOS
ftpconfig
ftpconfig(1M) System Administration Commands ftpconfig(1M)
NAME
ftpconfig - set up anonymous FTP
SYNOPSIS
ftpconfig [ftpdir]
ftpconfig -d ftpdir
DESCRIPTION
The ftpconfig script is executed by the super user to set up anonymous FTP. Anonymous FTP allows users to remotely log on to the FTP server
by specifying the user name ftp or anonymous and the user's email address as password. The anonymous users are logged on to the FTP
Server and given access to a restricted file area with its own file system root. See chroot(2). The FTP area has its own minimal system
files.
This command will copy and set up all the components needed to operate an anonymous FTP server, including creating the ftp user account,
creating device nodes, copying /usr/lib files, and copying timezone data. The passwd and group files set up have been stripped down to
prevent malicious users from finding login names on the server. The anonymous file area will be placed under ftpdir. If the ftp user
account already exists, then the current FTP area is used, and the system files in it are updated. All other files are left untouched. This
command should be run to update the anonymous FTP area's configuration whenever a system patch is installed, or the system is upgraded.
OPTIONS
-d Create a new or update an existing ftpdir without creating or updating the ftp user account. Use this option when creating guest
FTP user accounts.
OPERANDS
The following operands are supported:
ftpdir The absolute pathname of the directory under which the anonymous FTP area is set up.
EXIT STATUS
The following exit values are returned:
0 Successful completion
1 Improper usage of the command
2 Command failed
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWftpu |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO
ftpaddhost(1M), in.ftpd(1M), useradd(1M), chroot(2), attributes(5)
SunOS 5.10 1 May 2003 ftpconfig(1M)