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 ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
| 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 |
|
|||
|
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
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 9767209168 ------------------------------------------------ |
![]() |
| Bookmarks |
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 Automatically Delete a File via Cron Job | kakarla | Shell scripting | 2 | 01-29-2008 09:54 AM |
| writing a shell script to find out my shell name | jaymob123 | Shell scripting | 1 | 10-08-2007 01:36 AM |
| Shell scripting - Removing file extension | urbanreformer | Shell scripting | 3 | 03-07-2007 09:44 PM |
| Shell script to delete a file with a dialog utility | shankar100 | Shell scripting | 4 | 03-02-2007 11:22 AM |
| error shell script no such file or directory /bin/sh | Linux software | 1 | 01-08-2006 09:34 PM | |