Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Dear friend ,
I am going to create a customized ftp script . Scenario is stated below :
Suppose, I have two big size folder "test1" and "test2" . My mission is , Firstly i make those files as a "tar" file and then transfer the files to another machine using "ftp" protocol with time stamp facility (system date with time) .Script is :
==========================
Date1=`date +%d%b%Y`
Date=`date +%d%b%Y`.`date +%I`.`date +%M%p`
cd /test
tar -cvf test1_$Date.tar test1
tar -cvf test2_$Date.tar test2
ftp -i -v -n 192.168.10.1 <<END_FTP
user oracle oracle
binary
cd /tmp
mput test1_$Date.tar
mput test2_$Date.tar
bye
==============================
It works fine . this script create the file Like " test1_01Jan2008.08.10AM.tar " and "test2_01Jan2008.08.10AM.tar"
Now my problem is :
suppose file1 and file2 take 2 minutes to make "tar" file like following way :
"test1_01Jan2008.08.10AM.tar"
"test2_01Jan2008.08.10AM.tar"
In this situation , After two minutes my system date goes to 08:12AM . So that my next two lines
"mput test2_$Date.tar" and "mput test2_$Date.tar" are not executed . Because at that moment system date is 08:12AM , which are not matched with previous two lines .
Here in this stage i need urs help . Can any body plz give me any suggestions ........Waiting for kind reply ...
Another Question ,
Is it possible to ftp more than one file together ? Like following :
I have another issue . At the last stage of script , i add another two lines for removing the "tar" files from my local machine , Like follwoing :
Date1=`date +%d%b%Y`
Date2=`date +%d%b%Y`.`date +%I`.`date +%M%p`
cd /test
tar -cvf test1_$Date2.tar test1
tar -cvf test2_$Date2.tar test2
ftp -i -v -n 192.168.10.1 <<END_FTP
user oracle oracle
binary
cd /tmp
mput test1_$Date2.tar
mput test2_$Date2.tar
bye
rm -rf test1_$Date2.tar
rm -rf test2_$Date2.tar
But this script executes at the stage of "bye" , Next two lines are not executing . Now my question is , after "ftp" command, how can i execute another lines ?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.