1
vote
2answers
189 views

Properly escaping forward slash in bash script for usage with sed

I'm trying to determine the size of the files that would be newly copied when syncing two folders by running rsync in dry mode and then summing up the sizes of the files listed in the output of rsync. ...
1
vote
1answer
328 views

Does rsync delete files, folders at destination by default?

Files Suppose that /foo/src contains only A.c and that /foo/dest contains both A.c and B.c. And suppose I run the following command: rsync /foo/src/ /foo/dest Will rsync erase B.c? Folders Now ...
2
votes
2answers
310 views

Is there really no way in Linux to get creation time for files on cifs/smb share?

I am embarrassingly far along in a bash backup script and have missed something major. I know that ext3 filesystems don't track creation date, but copying files within ext3 updates the changed time as ...
0
votes
1answer
178 views

Error while executing bash command stored in string

Wrote a bash shell script that uses rsync to deploy files to live web server. Right before executing, the script outputs the full command that the my shell script generates: rsync --chmod="ug=rwx" ...
0
votes
1answer
120 views

Scripting with rsync, pulling more than the return status

I have a script to backup my images and alert me to the status of the script which gets run every 5 minutes. However, I want to figure out how to identify when rsync was successful, but didn't do ...
1
vote
0answers
57 views

Running a symlink locally

I am running the same program multiple times over a linux platform. It is compiled at another server, and frequently updated, and it's uploaded over through rsync to all "hosting" servers, which do ...
3
votes
2answers
186 views

restrict rsync (or bash script) to a directory

After a bad accident with rsync deleting wrong files due to wrong destination parameter, I want to restrict rsync (or the bash script running it) to be able to delete/modify files only under a certain ...
1
vote
1answer
400 views

Bash script fails from Windows 7 task scheduler

In order to use rsync I created a Bash script. It runs fine from the Cygwin 32-bit shell in Win 7 but fails when run from the Win 7 Task Scheduler. My Task Scheduler script is a simple: ...
2
votes
1answer
926 views

Permission denied using Rsync as root

All topics that I've come across involved rsync over ssh or rsync using a user with restricted access. I'm getting permission denied (13) errors as root. Here are my config files: /etc/rsyncd.conf: ...
0
votes
1answer
618 views

Rsync Remote To Local Issue

I was wondering if I could get some help with this rsync command. I am trying to copy files from a remote system by running rsync on the local system. Here is my command: /usr/bin/rsync -avz ...
2
votes
0answers
159 views

rsync: large exclusion list adding 10 hours to sync

I have had an rsync backup script running on a Centos 6 box that has been syncing ~410gb of data from a local (LAN) server over a gigabit connection. This script runs hourly, and if there are no new ...
1
vote
1answer
141 views

Bash/Rsync: One-way synchronize files, leave files alone when only metadata has changed

I have some programs that allow exporting to different formats (e.g. html), but many of them share a problem: Exports are always done "all together", i.e. things like images or attachments are created ...
0
votes
1answer
85 views

rsync in a bash script appears to work, but the files aren't updated on destination server

I've got a server where I do my web development and testing, and I have a bunch of frontend servers that sit behind a load balancer. I wrote a simple bash script to rsync a directory on my dev server ...
1
vote
3answers
305 views

rsync: Can it transfer files ignoring size (comparing only timestamp and name)?

Can rsync compare/copy based on mod date and filename alone, ignoring file size? Context: I'm trying to implement a two-stage backup using rsync. The first stage is onsite, and I have a bash rsync ...
1
vote
2answers
2k views

Rsync print only files that would have been changed

Is there a way to get rsync to print the full filepaths to all files that are different without actually transferring any files? Alternatively, I need a way to diff the files across two trees (over ...
0
votes
2answers
77 views

rsync {braces} fail?

I need some help in this issue: I want sync /path/first/ with /path/second/, /path/third/ ..etc so I've tried this: rsync -rv /path/first/ /path/{second,third,fourth}/ But it worked only for last ...
0
votes
0answers
148 views

rsync shell script

Need some hints on my first shell-script using rsync. I use rsync, because I had some trouble with a graphical Backup that ran twice and now I want this example as shown below to work on two external ...
2
votes
1answer
134 views

rsync with remote server causing media player issue

I have a ubuntu server running Serviio as a DLNA media server. pretty much the only other thing the server is doing is checking for new media on a remote server. I am running this script every minute ...
1
vote
2answers
374 views

Automate a remote rsync command using bash aliases?

I deal with lots of servers that often have files and folders which are not under version control. This means I can just git remote add if I need to work with the files on my local machine. With that ...
1
vote
2answers
470 views

How to avoid having to type password every time rsync is run in a Bash script?

In a bash script, I have several rsync statements. Every rsync will prompt for typing password, and defeats very much the automation of doing the job using a script. How to improve this? The ...
0
votes
1answer
716 views

How to copy only certain files and subdirectories

Hi let's say I have a directory like this: / my_work /dir1 keepdir1.ddd keepdir2.ddd file.cfg (lots ...
1
vote
1answer
185 views

Check for duplicate files in two collections, ignoring duplicates within A

I have four similar large collections of website files. They are archived copies of a similar directory tree from different times in the past. I want to merge them all to the most recent collection, ...
0
votes
1answer
1k views

Find modified files from rsync backup script

I'm using rsync on my Ububtu Linux server to take a time machine like backup of the system. Every hour, a cronjob runs the following script (partial excerpt): rsync -a --link-dest=/backup/current ...
0
votes
4answers
588 views

Rsync with a list of variables

I am trying to write a bash script that will rsync only a specific subset of folders. I am trying to figure out a more slick so that I can just add a variables such as FOLDER1='name of folder in home ...
2
votes
2answers
1k views

Bash script: dealing with spaces when running indirectly commands

I have been struggling for a while with the folllowing problems I have written scripts in which any command run is first put into a string, and then executed. That way, the command is written only ...
4
votes
2answers
3k views

rsync complaining about `missing trailing-"` in a Bash script

Trying to rsync files from one server to the other in a screen session. Instead of writing the long command every single time, I decided to put in a Bash script. However, when I run it, I get a ...
0
votes
1answer
641 views

Rsync in bash script not recognizing spaces

An excerpt from a bash script I'm using to backup some photos: #!/bin/bash FROM="/cygdrive/f/\"Trip to Austria\"" TO="/cygdrive/s/\"Trip to Austria\"" rsync -av $FROM $TO When I print the final ...
1
vote
1answer
799 views

Help with Watch Directory Script

First, I should note that I am pretty new to writing scripts, but I know my way around ubuntu well enough that I don't mind getting my hands dirty... I have a small script, which does a simple ...
4
votes
1answer
904 views

How do I sync file permissions (chmod +x) with rsync?

I'm having problems synchronising file permissions with rsync. I'm trying to sync my /home/bin folder with the /home/bin folder on a remote machine. The problem is that when I write a new script and ...
2
votes
2answers
1k views

Sync files between 2 remote computers using Linux terminal

I want to be able to synchronise files between 2 remote computers in both directions. Say for example that I want to synchronise my /home/Documents directory with ...
0
votes
1answer
5k views

Rsync Grabing Only New Files

I have a set of files in storage, and I would like to get only the new files and put it in another directory. Is there a way to do this? For example: The "old files" are contained in: ...
12
votes
3answers
10k views

linux merge folders: rsync?

I have two copies of a folder src/ dest/ I want to merge them, doing the following: If a file is only in src, I want it to be moved to dest If a file is only in dest, I want it ignored IE left ...
4
votes
2answers
2k views

rsync N newest files in a directory

What would be the easiest way to go about rsyncing the n newest files in a directory to a remote server?
1
vote
2answers
564 views

Why is bash rsync script not writing anything to file?

Ubuntu 9.10 crontab -l 0 1 * * * /root/cron/rsync-93.193.99.111 &> /root/cron/rsync-93.193.99.111.log 0 3 * * * tail -100 /root/cron/rsync-93.193.99.111.log | msmtp me@myemail.com ls -l ...
1
vote
1answer
106 views

$RYSNC_PASSWORD not being read/responded-to correctly (Snow Leopard)

Ignoring the security issues, I have the following script that synchronizes my music library from my MacBook Pro (running Snow Leopard) to the file store (CentOS 4) on my network: rsync -rav ...
5
votes
2answers
8k views

Use rsync to copy all files except for certain filenames with a certain extension

I have two same-size flash cards, and I want to copy contents of one to the other based on the following rules: I want all directories and subdirectories in place I want to exclude files of type ...
4
votes
2answers
2k views

Stop a Mac from sleeping while a bash script is running, then allow it to sleep as normal once complete

I've got my Mac to wake up during the night and run an rsync to back it up. This is configured through Energy Saver > Schedule. However it seems that it's going back to sleep before it can get ...