10

I want to sync a directory between my Mac High Sierra machine and a CentOs 7 machine, excluding a certain file. I have tried the below

(venv) localhost:dental davea$ rsync -e 'ssh -p 7822' --exclude='dental/wsgi.py' ~/Documents/workspace/dental/ laredotornado@remotedomen.com:/home/laredotornado
skipping directory /Users/davea/Documents/workspace/dental/.

I don't quite understand why it is always skipping the file I want to sync with. I have verified both the local and remote driectories exist but don't know where else to check as to why things are falling down.

5
  • 3
    Are you expecting it to do a recursive sync? Did you forget --archive or -a?
    – Kusalananda
    Feb 20, 2019 at 22:51
  • Are you running this from the dental directory? If you just want to exclude that file and you are already in the dental directory then you can specify the file itself with --exclude 'wsgi.py' as the path is already relative as far as rsync is concerned. Feb 20, 2019 at 22:58
  • @Kusalananda, that was it! Including "-a" moves stuff along.
    – Dave
    Feb 20, 2019 at 23:04
  • @Kusalananda Please propose your comment as answer and help close this question.
    – Atul
    Feb 20, 2019 at 23:10
  • 2
    @Atul I'm treating it as a typo. You may want to write a proper answer, explaining what's going on and how adding -a solves it, if you wish.
    – Kusalananda
    Feb 20, 2019 at 23:13

1 Answer 1

14

The rsync command didnt include the /Users/davea/Documents/workspace/dental/ directory as the -a was not used. Adding -a flag also includes the -r (recursive) flag in the operation thus allowing the directory to be part of the process.

Not the answer you're looking for? Browse other questions tagged or ask your own question.