Sponsored Content
Top Forums Shell Programming and Scripting Rsync to an external list of URLs Post 302241575 by ibsen on Monday 29th of September 2008 06:44:09 PM
Old 09-29-2008
OK, so I'm able to loop through the external file and read a line into a variable. (I'm working with Mac OS X.)

Code:
SRCURL="~/Desktop/listrsync/source/";
while read URL
do
	echo "$URL";
	echo "rsync -avz --dry-run $SRCURL $URL";
	rsync -avz --dry-run $SRCURL $URL;
done < ~/Desktop/listrsync/targets.txt

Within the targets.txt file, I have:

Code:
~/Desktop/listrsync/a/
~/Desktop/listrsync/b/
~/Desktop/listrsync/c/

When I run the script, it produces the output:

Code:
~/Desktop/listrsync/source/
~/Desktop/listrsync/a/
rsync -avz --dry-run ~/Desktop/listrsync/source/ ~/Desktop/listrsync/a/
~/Desktop/listrsync/b/
rsync -avz --dry-run ~/Desktop/listrsync/source/ ~/Desktop/listrsync/b/
~/Desktop/listrsync/c/
rsync -avz --dry-run ~/Desktop/listrsync/source/ ~/Desktop/listrsync/c/

As you'd said, the rsync command itself doesn't work when run from within the loop. I'm wondering, since I can get validly-formatted rsync commands from the output, is there a way to simply run them?

Maybe through piping?

Or a temp file?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Rsync file list

Hello, I'm trying to utilize rsync to backup 7 gigs of approximately 10,000 files, from what I've read this should be no sweat. However subsequent syncs seem to build an entirely new file list and the process takes a great deal of time. Reading the man page I'm not sure if I need to specify a file... (3 Replies)
Discussion started by: hexaplus
3 Replies

2. Shell Programming and Scripting

finding and removing patterns in a large list of urls

I have a list of urls for example: Google Google Base Yahoo! Yahoo! Yahoo! Video - It's On Google The problem is that Google and Google are duplicates as are Yahoo! and Yahoo!. I'm needing to find these conical www duplicates and append the text "DUP#" in from of both Google and... (3 Replies)
Discussion started by: totus
3 Replies

3. UNIX for Advanced & Expert Users

Rsync building file list/catalog path/location

Where is the file list created by rsync when it says building file list ? (1 Reply)
Discussion started by: glev2005
1 Replies

4. Web Development

Tricky mod_rewrite for clean urls problems when fetching external sources

Hi, I have problems with mod rewrite. I will try to describe... I want clean urls but fail to make it work propperly. Maybe I have problems, because the content displayed is fetched from my other site... There is a lot of stuff I already red about this, but somehow I can not find a solution... (2 Replies)
Discussion started by: lowmaster
2 Replies

5. Shell Programming and Scripting

Remove external urls from .html file

Hi everyone. I have an html file with lines like so: link href="localFolder/..."> link href="htp://..."> img src="localFolder/..."> img src="htp://..."> I want to remove the links with http in the href and imgs with http in its src. I'm having trouble removing them because there... (4 Replies)
Discussion started by: CowCow339
4 Replies

6. UNIX for Dummies Questions & Answers

rsync file list help

Is it possible to make rsync output a list of all the files transferred to a separate text file? If so how? I wondered if the --write-batch=FILE optionis what I need Thanks (1 Reply)
Discussion started by: barrydocks
1 Replies

7. Shell Programming and Scripting

Trying to extract domain and tld from list of urls.

I have done a fair amount of searching the threads, but I have not been able to cobble together a solution to my challenge. What I am trying to do is to line edit a file that will leave behind only the domain and tld of a long list of urls. The list looks something like this: www.google.com... (3 Replies)
Discussion started by: chamb1
3 Replies

8. OS X (Apple)

Rsync for back up, external HD

Hello all! I am quite unsure with all options of rsync. Here my backup configuration: I am on Mac X (10.8) and want an exact copy of my HD to an external HD. I formatted the new USB drive with Mac OS extended (Journaled, Encrypted) and made in my shell the following command and got the... (9 Replies)
Discussion started by: marek
9 Replies

9. Solaris

How can i list Solaris External storages?

Hi how can i list Solaris external storage's only, ie SAN, # for fs in `mount -p | egrep 'ufs|zfs|vxfs' | awk '{print $3}'`; do df -h $fs | sed 's/%//g' | grep -v capacity; done /dev/dsk/c2t5000C5003C31721Bd0s0 30G 18G 12G 61 /... (5 Replies)
Discussion started by: bentech4u
5 Replies

10. 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
spice-vdagent(1)					      General Commands Manual						  spice-vdagent(1)

NAME
spice-vdagent - Spice guest agent X11 session agent SYNOPSIS
spice-vdagent [OPTIONS] DESCRIPTION
The spice guest agent for Linux consists of 2 parts, a system wide daemon spice-vdagentd and a X11 session agent spice-vdagent of which there is one per X11 session. spice-vdagent gets automatically started in desktop environments which honor /etc/xdg/autostart, and under gdm. FEATURES
The spice guest agent adds the following features to spice Linux guests: Client mouse mode (no need to grab mouse by client, no mouse lag) Automatic adjustment of the X11 session's number of virtual monitors, and their resolution, to the number of client windows and their reso- lution Support of copy and paste (text and images) between the active X11 session and the client, this supports both the primary selection and the clipboard Support for transfering files from the client to the agent OPTIONS
-h Print a short description of all command line options -d Log debug messages -s port Set virtio serial port (default: /dev/virtio-ports/com.redhat.spice.0) -x Don't daemonize -f dir|xdg-desktop|xdg-download Set directory where to save files send from the client, this can be either an arbitrary dir or one of the special values of xdg- desktop or xdg-download to select the default xdg Desktop resp. xdg Download directory. If no value is specified the default is xdg- desktop when running under a Desktop Environment which has icons on the desktop and xdg-download under other Desktop Environments -o 0|1 Disable/enable opening the file save directory with xdg-open (showing the directory in the file manager) when a file transfer from the client completes. If no value is specified the default is 0 when running under a Desktop Environment which has icons on the desktop and 1 under other Desktop Environments SEE ALSO
spice-vdagentd(1) COPYRIGHT
Copyright 2010-2013 Red Hat, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. spice-vdagent 0.14.0 April 2013 spice-vdagent(1)
All times are GMT -4. The time now is 03:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy