Sponsored Content
Full Discussion: Auto FTP to a server
Top Forums Shell Programming and Scripting Auto FTP to a server Post 302068847 by systemali on Tuesday 21st of March 2006 08:59:12 AM
Old 03-21-2006
Hi Dhruv,

Please do share it here, Will be handy for every one.

Any ways, here is how i did it :-

Quote:
#!/bin/sh

# Variables that will be used.

SERVER=12.456.789
USER=username
PASSWD=password
PATH=/your/path/here

#Check if a valid input has been given

if [ $# -eq 0 ]
then
echo "Usage ./getftp.sh <file name to get>"
exit 0
fi

#Connecting via FTP to fetch a desired file.

/usr/bin/ftp -v -n "$SERVER" << cmd
user "$USER" "$PASSWD"
cd $PATH
binary
get $1
quit
cmd
echo "\n FTP session closed "

#Make Sure if the file has reached destination.

if [ -f $1 ]
then
echo "\n Hueston we have received the package\n"
else
echo "\n Oh oo..$1 does not exist on source"
fi

#Start your Validation.

exit 0
Hope this helps some one Smilie

Cheers !!!
 

10 More Discussions You Might Find Interesting

1. Programming

Auto FTP from UNIX to Windows Server

Hi, I am a not strong programmer and now my boss ask me how should I do a job to automated FTP that have error check. I know about: * using system() to call a command to trigger ftp in C Coding. The senarios as follows: 1. FTP the file(s) (e.g ELA_20060407.dat) to a given LAN server... (1 Reply)
Discussion started by: songtam
1 Replies

2. Shell Programming and Scripting

auto ftp the files

i have writen a shell to ftp a file automatically by taking the input from a file i have created on file tstftp as set timeout 120 ftp spawn ftp expect "ftp>" send "o 11.90.2.20 \r" expect "Name:" send "itcomxxl\r" expect "Password:" send "csms091206\r" expect "ftp>" send "prompt... (1 Reply)
Discussion started by: sasiprabu
1 Replies

3. UNIX for Advanced & Expert Users

Count and Auto FTP

Hi, I really need to create a script that counts for file and ftp's them to a windows directory. !st problem i'm having is getting it to ftp withouty prompting me, i tried |& on the end of the ftp, but then it just hits a syntax error. 2nd problem is, i have to have a wildcard in this script. which... (3 Replies)
Discussion started by: dappa
3 Replies

4. Solaris

Sun Server auto ping to 0.0.0.0

Hi All, 3 of my SAP sun server are continuosly pinging to the network address 0.0.0.0. I have no idea how this can happen, but they have something in common. All of them are clustered environment (Veritas Cluster). Anyone can help? rgds, (5 Replies)
Discussion started by: ronny_nch
5 Replies

5. Shell Programming and Scripting

Auto Ftp pseudo random file

I have a script that generates a file which is my own incarnation of a date using the 'date' function (we'll call this script a). I would like that script to invoke my other script (script b) which contains my ftp info. Since I have yet to figure out a good way to use regular ftp (yes i can only... (6 Replies)
Discussion started by: DC Slick
6 Replies

6. Shell Programming and Scripting

How to auto telnet the server from another server using script

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' I have to write a script, which is ran... (0 Replies)
Discussion started by: atul9806
0 Replies

7. Homework & Coursework Questions

How to auto telnet the server from another server

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' 1. The problem statement, all variables... (0 Replies)
Discussion started by: atul9806
0 Replies

8. Homework & Coursework Questions

How to auto telnet the server from another server?

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' 1. The problem statement, all variables... (8 Replies)
Discussion started by: atul9806
8 Replies

9. Shell Programming and Scripting

[Need HELP] Find aging file and auto FTP

Dear Experts, I have script to find aging file like this: find /ArchiveINTF/INTF name "*" -type f -mtime +365 {} \; >> agingfile.txt This script will find all files over 365 days. But, I have problem, how to auto FTP all files? Thanks Edy (3 Replies)
Discussion started by: edydsuranta
3 Replies

10. Red Hat

Implement FTP server on RHEL server without using FTP client

We have RHEL 5.8 in our environment, I had a query whether we can implement an FTP server using vsftpd package and Linux configurations like setsebool without using any external FTP clients like FileZilla etc. I am very confused on this. The FTP functionalities that should be present are download &... (3 Replies)
Discussion started by: RHCE
3 Replies
FUSESMB.CONF(5) 						File Formats Manual						   FUSESMB.CONF(5)

NAME
fusesmb.conf - the configuration file for fusesmb FILE FORMAT
The file consists of sections and parameters. A section begins with the name of the section in square brackets and continues until the next section begins. Sections contain parameters of the form: name = value. The file is line-based - that is, each newline-terminated line represents either a comment, a section name or a parameter. Section and parameter names are not case sensitive. Only the first equals sign in a parameter is significant. Whitespace before or after the first equals sign is discarded. Leading, trailing and internal whitespace in section and parameter names is irrelevant. Leading and trailing whitespace in a parameter value is discarded. Internal whitespace within a parameter value is retained verbatim. Any line beginning with a semicolon (``;'') or a hash (``#'') character is ignored, as are lines containing only whitespace. SPECIAL SECTIONS
fusesmb.conf can contain the following sections: The [global] section Section for global parameters. The [ignore] section Section for specifying servers and/or workgroups that should not be listed. The [/SERVER] section Section for server-specific settings. The section name should start with a slash ``/'' and not end with a slash. The [/SERVER/SHARE] Section for share-specific settings. The section name should start with a slash followed by the server name followed by a slash end- ing on the share name. It should not end with a slash. EXPLANATION OF EACH PARAMETER
This chapter explains each possible option. The section names - specified between parentheses after each option - shows the applicable sec- tions for this option. For example: ( [global] ) specifies that this option is only possible for the section [global]. ignore ( [/SERVER] ) Ignore this server. Possible values are: true, false, 1 and 0. Example: ignore = true interval ( [global] ) Interval for scanning the network for shares. Value is a number that specifies the network scanning interval in minutes. If the value is smaller or equal to zero the network is not scanned. Example: interval = 20 password ( [global], [/SERVER], [/SERVER/SHARE] ) Password. Value is string containing the password. Example: password = secret servers ( [ignore] ) Servers to ignore. Value is each server to ignore separated by a comma. Example: servers = SERVER1, SERVER2, SERVER3 showhiddenshares ( [global], [/SERVER] ) Show hidden shares. Possible values are: true, false, 1 and 0. Example: showhiddenshares = false timeout ( [global] ) Connection timeout in seconds. A server after this timeout is considered offline. Values smaller than 2 seconds are ignored. Example: timeout = 10 username ( [global], [/SERVER], [/SERVER/SHARE] ) Username. Value is string containing the username. Example: username = johndoe workgroups ( [ignore] ) Workgroups to ignore. Value is each workgroup to ignore separated by a comma. Example: workgroups = WORKGROUP1, WORKGROUP2 EXAMPLE
; Global settings [global] ; Default username and password username=user password=totallysecret ; List hidden shares showhiddenshares=true ; Connection timeout in seconds timeout = 10 ;Interval for updating new shares in minutes interval = 10 ; Section for servers and/or workgroups to ignore [ignore] servers=SERVER,SERVER2,SERVER3 workgroups=WORKGROUP,WG2 ; Share-specific settings [/SERVER/SHARE] username=john password=doe ; Server-specific settings [/SERVER] username=jane password=doe showhiddenshares=true ignore=true SEE ALSO
fusesmb(1) AUTHOR
Vincent Wagelaar <vincent@ricardis.tudelft.nl>. August 5, 2005 FUSESMB.CONF(5)
All times are GMT -4. The time now is 05:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy