Linux / UNIX Tech Support Forum
This is a discussion on Bash Shell Script To Ftp File To Server within the Getting started tutorials forums, part of the Linux Getting Started category; Hello Nixcraft users, I had a requirement to use a shell script that I needed to call from a crontab, ...
|
|||||||
| Getting started tutorials So much to read, so little time! If that is your problem, we have solution. Read our FAQ and tutorials to help you cut through the clutter of information overload. Only members of "contributors" group can post new tutorials. Other members can just reply to thread. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| The Following User Says Thank You to jaysunn For This Useful Post: | ||
anak_jkt (10-11-2009)
| ||
| Sponsored Links | ||
|
|
|
||||
|
Yes, you can even create date folder for each day on server:
Code:
NOW=$(date +"%d-%m-%Y") DEST="/backup/$NOW" ftp -inv $HOST << EOF user $USER $PASS mkdir $DEST cd $DEST ... FTP MySQL and Webserver System Backup script
__________________
Vivek Gite Linux Evangelist |
|
||||
|
Sir,
May I say. This is a great wizard: FTP MySQL and Webserver System Backup script Upon viewing the php source code I was intrigued by this. As always....... Thanks Vivek |
|
|||
|
Quote:
Quote:
|
| The Following User Says Thank You to cfajohnson For This Useful Post: | ||
jaysunn (31-12-2009)
| ||
|
||||
|
Hello Mr. Johnson,
Quote:
Best Regards, Jaysunn |
|
||||
|
Disregard.
Google is my friend. http://linux.about.com/library/cmd/blcmdl5_netrc.htm Unix -> .netrc http://www.google.com/codesearch?cli...ed=0CBYQrwQwAw Thanks for the tip. Jaysunn Last edited by jaysunn; 31-12-2009 at 12:10 AM. |
|
|||
|
Quote:
Code:
man ftp |
|
||||
|
Yes I see now.
I researched this tremendously after you have pointed it out. RHEL: Code:
-n Restrains ftp from attempting ''auto-login'' upon initial connection. If auto-login is enabled, ftp will check the .netrc (see below) file in the user's home directory for an
entry describing an account on the remote machine. If no entry exists, ftp will prompt for the remote machine login name (default is the user identity on the local machine), and,
if necessary, prompt for a password and an account with which to login.
Code:
-N netrc Use netrc instead of ~/.netrc. Refer to THE .netrc FILE for more information. Thanks for the insight. I am excited to implement this on many servers. As well as getting my senior engineer jealous for understanding this before him.... THanks Again, Jaysunn |
|
||||
|
.netrc is standard these days, but if you ever get chance to work on older proprietary UNIX os like *cough* Solairs, AIX *cough* you will not find anything like .netrc. This is main reason for using ftp -u user syntax. Also ~/.netrc does not make your script secure. Both has its own security problem. If possible avoid using ftp and switch to rsync or scp / sftp. Those are secure and much better alternatives. These days OpenSSH is part of all UNIX like operating systems except *cough* MS-Windows server *cough*
__________________
Rocky Jr. What's wrong? I hope I am not making you uncomfortable... Never send a boy to do a mans job. |
![]() |
| Tags |
| ftp , ftp login , ftp script , ftp script linux , ftp script unix , ftp shell script |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Solved] UNIX File Descriptors In Bash Shell | raj | Shell scripting | 5 | 28-09-2009 03:57 AM |
| Bash FTP unload script (single file from list) | Boruts5 | Shell scripting | 0 | 26-02-2009 03:51 PM |
| Please suggest me this easy bash shell script | nextcmchiranjeevi | Shell scripting | 1 | 11-02-2009 02:34 AM |
| 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 |