Rsync of several directories


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Rsync of several directories
# 1  
Old 03-24-2013
Rsync of several directories

Dear all,

I am writing a script to backup a big quantity of directories from one laptop to a server.

In a script on the server, I have a loop in bash like this:

Code:
for SRC_DIR in "$LIST_OF_DIR_TO_BACKUP" ; do

rsync -av user@laptop:/home/user/$SRC_DIR /home/user/backup

done

As I said I have a lot of directories and they change often.
2 questions :

1) I wonder if in the loop I should wait that the sync of one directory is completed before starting the sync of the next directory?
2) if yes, how should that be done?

Many thanks for your help and kind regards,
freddie50
# 2  
Old 03-24-2013
It looks like your loop will wait until rsync is completed until invoking it again for next directory.
This User Gave Thanks to Peasant For This Post:
# 3  
Old 03-24-2013
Ok,

Great!
Thanks!!!
freddie50
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

Giving read write permission to user for specific directories and sub directories.

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies

2. Shell Programming and Scripting

Rsync Error: rsync: link_stat failed: No such file or directory (2)

I wish to copy all the files & folder under /web/Transfer_Files/data/ on mymac1 (Linux) to remote server mybank.intra.com (Solaris 10) /tmp/ location I am using Ansible tool synchronize module which triggers the unix rsync command as below:rsync --delay-updates -F --compress --archive --rsh=ssh... (2 Replies)
Discussion started by: mohtashims
2 Replies

3. UNIX for Advanced & Expert Users

Rsync - delete extra files in Destination without synchronising directories

I have a script that synchronises a directory to a DR server, but to improve the time, I actually use rsync to transfer files * in one batch and also * in another batch - both batches run from the same script and run in the background. My problem is that there isn't much space on the... (1 Reply)
Discussion started by: Catullus
1 Replies

4. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

5. UNIX for Dummies Questions & Answers

Rsync on Cygwin - Restrict user to several directories

Hi, I'm using rsync on cygwin (winXP) to sync our files between several laptops and XP (acting as a file server) For simplicity I use the same user account with different certificates over SSH. Now my question is; If a user understands the logic and modifies the rsync command, he can easily... (0 Replies)
Discussion started by: cemo
0 Replies

6. Shell Programming and Scripting

rsync multiple directories into single directory on remote

I would like to find and backup all *.mp4 files from /Pictures and its sub-directories and move them to a single directory on a remote. I can find and move the files but I don't want the directory structure...just the files to be placed in a single remote directory. To find my files I use ... (1 Reply)
Discussion started by: wreckedred
1 Replies

7. Shell Programming and Scripting

How to list all the directories, sub directories in a mount along with size in ascending order?

Hi , I am very new to unix as well as shell scripting. I have to write a script for the following requirement. In a particular mount, have to list all the directories and sub directories along with size of the directory and sub directory in ascending order. Please help me in this regard and many... (4 Replies)
Discussion started by: nmakkena
4 Replies

8. Shell Programming and Scripting

rsync multiple remote directories one connection

Hi, I want to specify multiple remote directories but want to transfer them in a single command with one connection with remote server. e.g. rsync -vrt --size-only --delete user@host:/home/user1/dir1 user@host:/home/user1/dir2 user@host:/home/user1/dir3 .... local_dir/ I want to... (0 Replies)
Discussion started by: sardare
0 Replies

9. Shell Programming and Scripting

Script for parsing directories one level and finding directories older than n days

Hello all, Here's the deal...I have one directory with many subdirs and files. What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file. A script for... (5 Replies)
Discussion started by: ejianu
5 Replies
Login or Register to Ask a Question