How to wait for tar to finish before sending the archive through ftp?
Hey all,
I want to automate tarring a directory then using ftp to transfer the files over.
I was able to put the commands together but what I'm noticing is that only the very first file is being tarred and then transferred.
Above is the command I'm using which works fine on its own but it looks like right after the command is executed in my script the ftp command is also executed immediately after which results in bad data.
How am I supposed to get around this? Is there a way to wait for a previous command to finish?
I was reading up on subshells; putting the command in ( ) but that did not work
I also tried using it with wait.
I'm going to try and execute the command in another script and see if my shell will wait for it to finish but I'm hoping someone out there can give me some insight?
Thanks a bunch,
Erin
---------- Post updated at 07:37 PM ---------- Previous update was at 07:25 PM ----------
I got it to work this way to control the execution sequence
My shell script will now not move forward until the first command argument has succeeded then it will process the echo statement
Is there any alternatives to this? I would love to hear them
Does anyone see any issues with the way I'm doing this?
It really depends on how your FTP script works. If those commands were in the same script just run line-by-line, it'd wait for tar to finish. You're running two separate scripts and connecting them somehow...
Could you show how you do the whole procedure, not just the tar end?
This works
But if I remove the && operand the ftp portion executes immediately (I think) after the tar and when I view the tar on the ftp host, it only records the first file
that very same file that gets sent over to the ftp host is fine when I look at it on the original server
This works
But if I remove the && operand the ftp portion executes immediately (I think) after the tar and when I view the tar on the ftp host, it only records the first file
It won't execute immediately, it will wait for tar.
If you had a stray & (single) after tar, that could have put tar into the background and caused those symptoms.
Hello all,
I have a very basic question. I have a requirement where in, I have a main process which forks a child process, which execs and runs a c executable corresponding to a daemon. In the c executable corresponding to a daemon, as everyone does, I fork another child process, and as part of... (7 Replies)
I have a huge directoy(200+ gb) for backup. I want upload the tar file(split files) simultaneous to a remote ftp. (pipeline, stdout, stdin etc.)
I don't want write a data to local hdd. I have a ssd hdd. thanks.
this code doesn't work.( yes i know the problem is split command!)
tar cvzf -... (8 Replies)
I have the shell script to call a Perl routine and pass the Informatica WorkFlow name to it. Jobs in each group executes in background do not seem to wait at all. How do I make it to WAIT for the prior group to complete before execute the next group of jobs?
Sample of the jobs flow:
{
... (6 Replies)
I have made tar archive of my system.. How can I make that tar archive to be bootable.. simply to install new linux from the archived tar file.. thanks in advance (8 Replies)
Huloo,
whats diff between TAR+zip+FTP and TAR+FTP,can't we simpply FTP a file without Zipping it?
TAR is simply for Archiving ,then why do we need to Zip it?
:( (1 Reply)
Hi All
Here i have a piece of code,
set filename "./GopiRun.sh"
#I need to wait here until the GopiRun.sh is completed how do i achive this
exit. (1 Reply)
hey
how do you create a archive and add file to an existing archive.
i keep getting an error: dir/#: No such file or directory
currently using tar -cvfu name.tar files
files searching from a word document each line having different file extention.
Thanks in advance (1 Reply)
Hi,
I want to archive below directories
ex: /home/oracle/ddd0
/home/oracle/ddd1
/home/oracle/ddd2
I want a command(tar) which will let me archive the above directories excluding *.dmp(dump files), *.log(log files) in those directories.
So the archived file doesn't have... (4 Replies)
Hi all,
I have 1 problem in my solaris 8 server. The problem is in every nite that will run a cron job to download file from external ftb server. This crob job starter running find, but after running for 4 minute, that ftp services is hang that, until we need kill this process.
My question... (3 Replies)
Have a need to schedule programs that can run after other programs are completed. Here's the catch:
1) The list of programs will not always be the same (kind of a plug-n-play deal)
2) The invoking shell may not be the same as the shell of the program being waited on
In other words, I need... (2 Replies)