Posts

Showing posts with the label rsync

Use rsync to copy a directory structure

To copy the directory structure only without copying any files: rsync -a -f"+ */" -f"- *" source destination/ If you don't put the trailing / on source you'll get the source directory created in destination. If you put the trailing / after source, you'll get all of the subdirectories of source created in destination without the top source directory. Source

Rsync transfer statistics

I wanted to take a look at the total amount of data that would be transferred for an rsync operation. Running  /usr/bin/rsync --dry-run -avhz --delete -e ssh /sourcepath destserver:/destpath would give the the Total Size of the /sourcepath but not the amount transferred. Adding --stats will give you the amount of data that needs to be transferred to get the /sourcepath and /destpath in sync /usr/bin/rsync --dry-run -ahz --stats --delete -e ssh /sourcepath destserver:/destpath

rsync from iTunes dir to SD card

So I'm using rsync to get music from my Mac to the SD card in my Samsung Intercept. I don't want all my music, I want to pick and choose. I'm using the following as my rsync command: rsync -hrltvz --modify-window=1 --exclude-from=exclude-from-file My exclude-from-file looks like this: - *.m4p - *.wav - *.DS_Store + Blue October/*** - * The final - * tells rsync to skip everything. The only thing that is copied over is the Blue October directory and everything under that directory. Any .m4p, .wav, and .DS_Store files are also excluded. To add a new artist for syncing I just add a line + artist/*** to the exclude file.

rsync to SD card recopying files

I was trying to rsync some iTunes music to an SD card from my Mac. All was working well but all the files were being synced each time. Turns out it's an issue with a Microsoft(FAT32) formatted card, which my Samsung Intercept has. Answer was to add --modify-window=1 as an rsync option. Solution here .