Linux / UNIX Tech Support Forum
This is a discussion on Shell script for ftp the file within the Shell scripting forums, part of the Development/Scripting category; Hi all , i need your help , it's very urgent i want the shell script to ftp the file ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi all ,
i need your help , it's very urgent i want the shell script to ftp the file from perticular server and copy in to another server. Thanks |
| Sponsored Links | ||
|
|
|
||||
|
Code:
#!/bin/sh BAK="/backup" # store all backup files here FTPU="ftp-username" FTPP="ftp-password" FTPS="ftp-server-ip" NOW=$(date +"%d-%m-%Y") lftp -u $FTPU,$FTPP -e "mkdir backup/$NOW;cd backup/$NOW; mput $BAK/*; quit" $FTPS See More script @ Shell Script Directory : FTP
__________________
Vivek Gite Linux Evangelist |
|
|||
|
Thanks for your reply , i need your help agin to solve my following problem.
I want the command that should look for files which were created in the last 2 hrs. For example let's say the following files were created in the server 8 am - mpsacba_20070815_08 9 am - mpsacba_20070815_09 10 am - mpsacba_20070815_10 11 am - mpsacba_20070815_11 12 pm - mpsacba_20070815_12 1 pm - mpsacba_20070815_13 When our process runs at 10 am it should pick up mpsacba_20070815_09 and mpsacba_20070815_10 (which are the files which are created since the last run). it should pick up those files where were created since the last time our process ran. |
|
||||
|
Dear friend use this, it will help you
Code:
#!/bin/sh FILE_NAME="path_of_file" HOST='IP Addr. of ftp server' USER='user_name' PASSWD='user_passwd' ftp -nv <<EOF open $HOST user $USER $PASSWD cd db_backups/PUNE/ put $FILE_NAME EOF
__________________
Anil V. Rathod RHCE System Administrator Styling Studio, ERC INCAT | A TATA Technologies Company www.incat.com www.tatatechnologies.com Email- anil.rathod@incat.com ------------------------------------------------ Cell No. +91 9011094209 ------------------------------------------------ Last edited by nixcraft; 21-08-2009 at 07:10 PM. Reason: code tag added |
![]() |
| Tags |
| ftp , ftp scripts , linux ftp login script , shell scripting |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| shell script to read a line in gps receiver log file and append that line to new file | gudivada213 | Shell scripting | 2 | 28-06-2009 09:10 PM |
| shell script output to log file in /var/log/ | asim.mcp | Shell scripting | 6 | 13-05-2009 04:04 PM |
| Shell Script To Outputs File Permissions of Most Recently Modified File | glen_4455 | Shell scripting | 1 | 25-08-2008 02:39 PM |
| shell script to search specific file from txt file inside zip file and extract it | aasif.shaikh | Shell scripting | 2 | 31-05-2008 06:44 PM |
| error shell script no such file or directory /bin/sh | Linux software | 1 | 08-01-2006 08:34 PM | |