05-22-2007
FTP scrtip: Unix to windows directory
Hi, I'm trying to automate a ftp from a unix box to a windows directory. But i want it to count and only move the files if they are there so that i can cron it. This is what i have, but seems to be failing, can anyone spot what is going wrong?
#! /usr/bin/ksh
cd ????/????/par/942852
HOST=???.???.???.???
USER=USER
PASSWD=PWRD
count="$(find ????/????/par/942852/ -name "????*" -print | wc -l)"
if [[ $count -gt 0 ]]
then
exec 4>&1
ftp -nv >&4 2>&4 |&
print -p open $???.???.???.???
print -p user $USER $PWRD
print -p cd \\???.???.???\WINDOWS\SYSTEM
print -p ascii
print -p put ????*
print -p bye
wait
exit 0
else
exit 0
fi
cd ????/????/par/942852
mv ????* cd ????/????/par/942852/proc/
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Any body any ideas i'm failry new to this so any help would be appreciated.
Cheers
Steve (2 Replies)
Discussion started by: gleads
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I have been using ftp to transfer files back and forth between windows and unix machines. But everytime i started the ftp session from the windows machine.
I have a question why I am not able to connect to the same windows machine from the same unix machine.
How do I do this?
... (11 Replies)
Discussion started by: oldtrash
11 Replies
3. IP Networking
Hi
I can transfer a single file and multiple file from unix to widows using get and mget command.But i dont know How to transfer a whole directory from unix to windows using command.
pls help me
Ramkumar (1 Reply)
Discussion started by: ramkumarm83
1 Replies
4. Shell Programming and Scripting
How to do ftp from unix to windows
i have some files in a dir in unix box and i want to put those files in windows through FTP. How to do this ? (9 Replies)
Discussion started by: ali560045
9 Replies
5. Shell Programming and Scripting
i need to ftp a file from windows to a unix machine by executing a sript(perl/shell/php) from that unix machine.i can also use HTML and javascript to build forms. (3 Replies)
Discussion started by: raksha.s
3 Replies
6. Shell Programming and Scripting
Move a file from windows directory to unix directory, is this possible?
if it is, can someone help me on this?
Thanks! God bless! (1 Reply)
Discussion started by: kingpeejay
1 Replies
7. Shell Programming and Scripting
will this work, knowing that the file is in a directory in windows.. It is
going from a drirectory in windoxs to UNIX \
# Error Handling Function
function ErrorHandle
{
# if type is 1, then the file does not exist or unreadable
if
then
echo "File... (5 Replies)
Discussion started by: rechever
5 Replies
8. AIX
Hi Friends,
I have this script for ftping files from AIX server to local windows xp.
#!/bin/sh
HOST='localsystem.net'
USER='myid_onlocal'
PASSWD='mypwd_onlocal'
FILE='file.txt' ##This is a file on server(AIX)
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
put $FILE... (1 Reply)
Discussion started by: rajsharma
1 Replies
9. Shell Programming and Scripting
Hi, I am new to this subject.....Can someone please help me out with the script...
unix usernm "sdhftst"
unix pwd "chsd13"
windows usernm "dfghtst"
windows pwd "chsd13"
path..../xxx/xxxxx/xxxxxx/xxxxxxx
please can u get me a script...its only one file to get ftp.
Thanks... (2 Replies)
Discussion started by: himakiran9
2 Replies
10. Shell Programming and Scripting
Hi,
Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting?
If so what command i need to use.
thanks in advance. (1 Reply)
Discussion started by: Shri123
1 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)