LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-13-2006, 11:21 PM   #1
chris28
LQ Newbie
 
Registered: Nov 2004
Distribution: linux red hat 9
Posts: 7

Rep: Reputation: 0
RSYNC and BASH


Hello

I need to write a bash script to do automated backups of various files via rsync over ssh.
will bash start the 1st rsync transfer, and the start the next one after the first has finished,
or will is rush threw the script and rapidly start all the rsync transfers.
Do I need to add in some sort of delay in to the bash?


Thanks
Chris
 
Old 02-13-2006, 11:39 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 166Reputation: 166
Do you have one script with a series of rsync commands that aren't put into the background with '&'? If so, as far as I know bash will execute them sequentially and wait for the return code from each of them.
 
Old 02-13-2006, 11:42 PM   #3
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
When running commands (whether manually or in a script) execution is synchronous. That is, control is not returned to the shell until the command execution completes. You can override this behavior by running commands as background processes (suffixing the command with an ampersand, '&').

So to directly answer your question, the rsync commands will run one at a time until they complete, unless you do something special to make them all run at the same time.
 
Old 02-14-2006, 05:21 PM   #4
chris28
LQ Newbie
 
Registered: Nov 2004
Distribution: linux red hat 9
Posts: 7

Original Poster
Rep: Reputation: 0
So, it won’t start the next rsync transfer until the previous one has finished?

Thanks
Chris
 
Old 02-14-2006, 05:31 PM   #5
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,138

Rep: Reputation: 166Reputation: 166
Correct - unless you force a task into the background, interactive shells and scripts wait for it to complete.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Bash: Print usage statement & exit; otherwise continue using Bash shorthand operators stefanlasiewski Programming 9 02-07-2006 06:20 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 03:49 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 07:42 PM
Rsync eddiefdz Linux - Software 0 02-20-2004 02:56 PM
bash script HELP - dnotify > rsync GuitsBoy Programming 5 01-28-2004 10:42 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration