Discover Centmin Mod today
Register Now

Remote server sync from Live server, rsync options

Discussion in 'System Administration' started by rdan, Nov 27, 2018.

Tags:
  1. rdan

    rdan Premium Member Premium Member

    4,417
    1,059
    113
    May 25, 2014
    Ratings:
    +1,542
    Local Time:
    2:56 PM
    Mainline
    10.2
    Currently I'm using:
    What could be wrong or can be improve with my option?
    I've read it all here: Linux rsync command help and examples
    But maybe you guys can suggest better options.

    Thanks!
     
  2. rdan

    rdan Premium Member Premium Member

    4,417
    1,059
    113
    May 25, 2014
    Ratings:
    +1,542
    Local Time:
    2:56 PM
    Mainline
    10.2
    Just recently I discovered --delete won't work without -r.
    :blackeye:
     
    • Informative Informative x 1
  3. eva2000

    eva2000 Administrator Staff Member

    37,227
    8,133
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,521
    Local Time:
    4:56 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    I usually use the ones I list in my guide at Upgrade - Nginx - Redis - Insight Guide - Centmin Mod Site Data Migration Guide = avzin for dry runs and avzi for live runs combined with --progress --stats
    Code (Text):
    rsync -avzi --progress --stats -e "ssh -p $port -i $HOME/.ssh/$privatekey"
    

    where $port = SSH port and $privatekey is name of SSH private key

    FYI some of your flags like -r are duplicated as you already have -a
    strange did you have -a ?
     
    • Like Like x 1
  4. rdan

    rdan Premium Member Premium Member

    4,417
    1,059
    113
    May 25, 2014
    Ratings:
    +1,542
    Local Time:
    2:56 PM
    Mainline
    10.2
    I already have -aze before and thought it work as expected.
    But when testing it with -avzhe, to view the log/stats on CLI I got a complain that --delete won't work without -r.
     
  5. rdan

    rdan Premium Member Premium Member

    4,417
    1,059
    113
    May 25, 2014
    Ratings:
    +1,542
    Local Time:
    2:56 PM
    Mainline
    10.2
    I tried again now with only this option:
    It did work without warning/error :unsure:.
     
  6. eva2000

    eva2000 Administrator Staff Member

    37,227
    8,133
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,521
    Local Time:
    4:56 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    order of commands is important

    Code (Text):
    rsync -avzin --progress --stats --delete src/ dest/
    sending incremental file list
    *deleting   src/file.txt
    *deleting   src/
    *deleting   file-delete.txt
    .d..t...... ./
    >f+++++++++ file.txt
    
    Number of files: 2 (reg: 1, dir: 1)
    Number of created files: 1 (reg: 1)
    Number of deleted files: 3 (reg: 2, dir: 1)
    Number of regular files transferred: 1
    Total file size: 0 bytes
    Total transferred file size: 0 bytes
    Literal data: 0 bytes
    Matched data: 0 bytes
    File list size: 0
    File list generation time: 0.001 seconds
    File list transfer time: 0.000 seconds
    Total bytes sent: 69
    Total bytes received: 72
    
    sent 69 bytes  received 72 bytes  282.00 bytes/sec
    total size is 0  speedup is 0.00 (DRY RUN)
    


    -e has to be separate as it passes on ssh/port options
     
    • Informative Informative x 1
  7. rdan

    rdan Premium Member Premium Member

    4,417
    1,059
    113
    May 25, 2014
    Ratings:
    +1,542
    Local Time:
    2:56 PM
    Mainline
    10.2
    Why and what should I follow for the correct order?
     
  8. eva2000

    eva2000 Administrator Staff Member

    37,227
    8,133
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,521
    Local Time:
    4:56 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  9. rdan

    rdan Premium Member Premium Member

    4,417
    1,059
    113
    May 25, 2014
    Ratings:
    +1,542
    Local Time:
    2:56 PM
    Mainline
    10.2
    So must be?
    Code:
    rsync -avzh -e 'ssh -p 1234' --delete
     
  10. eva2000

    eva2000 Administrator Staff Member

    37,227
    8,133
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,521
    Local Time:
    4:56 PM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    try
    Code (Text):
    rsync -avzh --delete -e 'ssh -p 1234'
    
     
    • Like Like x 1
    • Informative Informative x 1
..