LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   rsyncing files based on size (https://www.linuxquestions.org/questions/ubuntu-63/rsyncing-files-based-on-size-4175601281/)

salilsurendran 03-07-2017 08:30 PM

rsyncing files based on size
 
I am trying to rsync files with the extension *.scala and only those no other files between two directories. If the size is different they should be synced. I am executing this command and seeing no scala files being synced even though I know the sizes are different.

rsync -rnvh --ignore-times --size-only --include '*/' --include '.scala' --exclude '*' /home/salilsurendran/code/servlet-app /home/salilsurendran/code/sbt-runs/servlet-app/

With the -n option I am doing a dry run and the output prints out a bunch of directories but not any files. Please help

business_kid 03-08-2017 05:43 AM

rsync checks file timestamps & sizes by default.Are you content to update new files with old?. If you intend
rsync [options] dirA dirB I would start by
copying dirB to dirC, & run
time rsync -a dirA/filespec dirC, and see what went wrong. Then use options to correct errors

TxLonghorn 03-08-2017 08:36 AM

I am no expert, but it seems to me that if you put --include '.scala' and then follow that with --exclude '*' you are excluding all files.
Why would you need --exclude '*' ?
If you want to include all files with the extension .scala then you would put --include '*.scala' - right?

pan64 03-08-2017 09:40 AM

you can try a lot of options (of rsync), like:
Code:

  -i, --itemize-changes
  -v, --verbose              increase verbosity
            --info=FLAGS            fine-grained informational verbosity
            --debug=FLAGS          fine-grained debug verbosity

but if nothing works you can run a find to look for files you want to rsync and use --files-from=FILE


All times are GMT -5. The time now is 07:29 PM.