rsync recursive

Using OpenSuse V13.2

I’m trying to copy all the mp3s, under a directory, onto a thumbdrive, and replicating the directory structure on the thumbdrive, by using the following command

 rsync --recursive --checksum --verbose  --progress --stats  --log-file=/home/john/Eight_Copy_Log.txt    /home/john/___John/All/*.mp3     /var/run/media/john/F009-64A5

rsync doesn’t recurse into the subdirectories when *.mp3 is present.

Without the *.mp3, everything gets copied.

I’ve tried many permutations with include file, exclude file with no luck.

I must be overlooking something.

Thank you.

I am not that fluent with rsync, but my guess is that you forgot that your line is first handled by the shell (bash). This will expand the *.mp3 and the * will never be seen by rsync (let alone worked on).

Check this by replacing rsync with echo

echo --recursive --checksum --verbose  --progress --stats  --log-file=/home/john/Eight_Copy_Log.txt    /home/john/___John/All/*.mp3     /var/run/media/john/F009-64A5

This will show you what arguments the rsync program gets offered.

Might want to try a luckybackup it has a nice GUI interface

On 10/09/2015 08:26 AM, gogalthorp wrote:
>
> Might want to try a luckybackup it has a nice GUI interface
>
>

Both wrong!!!

To have rsync copy files/directories recursively you must use a trailing
/ in the source and destination.

Example:

Code:


rsync <options go here> /some-source-directory /destination

will only copy the files from the source directory (NO recursive copy).
(man rsync)

Where as:

Code:


rsync <options> /some-source-directory/ /destination/

will copy all files and directories from the source directory.

If you have no/little experience with rsync (or any program) it’s better
to offer nothing then to give wrong information.

Hope this helps the OP to better understand rsync.

Ken
linux since 1994
S.U.s.E./openSUSE since 1996

You have a problem with luckybackup. It is simply a GUI front end to rsync and thus much easier to deal with :wink:

On 10/09/2015 01:06 PM, gogalthorp wrote:
>
> You have a problem with luckybackup. It is simply a GUI front end to
> rsync and thus much easier to deal with :wink:
>
>
I have no problems with luckybackup and did not imply that I did. One
nice thing about linux, there are many ways to skin the cat. The OP was
referring to CLI use so luckybackup has no bearing to his question.
I have never used luckybackup so I cannot give advice with it’s use.
Can it be used in a batch mode via cron? No, then CLI is better. It’s
all a matter of preference.

Ken :slight_smile:

linux since 1994
S.U.s.E./openSUSE since 1998

The OP wanted to backup only files with names ending in .mp3. The solution that you offered above does not provide that IMHO.

Luckybackup will generate the line for him and he can still use it in a script or run LB to periodically do the backup. Because LB allow you to save the actual line created

On 10/09/2015 07:06 AM, DoraPatterson wrote:
> Code:
> --------------------
> rsync --recursive --checksum --verbose --progress --stats --log-file=/home/john/Eight_Copy_Log.txt /home/john/___John/All/*.mp3 /var/run/media/john/F009-64A5
> --------------------

Modify the above to:

Code:

rsync --include=*.mp3 --checksum --verbose --progress --stats
–log-file=/home/john/Eight_Copy_Log.txt /home/john/___John/All/
/var/run/media/john/F009-64A5/

and let us know how that worked. I forgot you only wanted certain files
copied in my earlier post.

HTH

Ken
linux since 1994
S.U.s.E./openSUSE since 1996

On 10/09/2015 04:06 PM, gogalthorp wrote:
>
> Luckybackup will generate the line for him and he can still use it in a
> script or run LB to periodically do the backup. Because LB allow you to
> save the actual line created
>
>

That’s good to know. I wish all GUI programs would show what the CLI
command would be.

Ken
linux since 1994
SuSE/openSuSE since 1996

Grsync is another GUI for rsync that i use, and it also provides you the command line equivalent of what task you are wanting it to do :slight_smile:

Never used LuckyBackup so I dont know how they both compare to each other.