rsync to copy files which has changed

Zama Ques

I need to copy some files from a particular directory to a different location on a daily basis. I want to copy the changes only, so planning to use rsync. These files follows the following naming convention mysql-bin.*

My command looks as follows

# rsync --update -raz --progress /var/lib/mysql/mysql-bin.*  /dbdata/binarylog/

My confusion is since I am planning to copy only few files from a directory rather than full directory contents , I have used * to copy only required files. Just want to know whether my command is correct to achieve the same.

garethTheRed

It looks OK. Although why are you using the -z option to compress the transfer? This option is normally used when you are copying to a remote rsync server over a slow network. In this instance it will compress and instantly decompress the files which will only increase your CPU uage with no benefit.

The -a (archive) option implies the -r (recursive) option so there is no need to explicitly specify that on the command line.

You can use the -n option (or --dry-run) to check your command. It will show what it would do without actually copying any files. To actually see what happens you should also use the -v option (or --verbose).

Therefore:

rsync -uanv /var/lib/mysql/mysql-bin.*  /dbdata/binarylog/

and once you're happy that the files are listed correctly on the dry-run, remove the nv:

rsync -ua --progress /var/lib/mysql/mysql-bin.*  /dbdata/binarylog/

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Rsync copy only changed files; ignore file modification time stamps

分類Dev

rsync has been interrupted - copy from beginning

分類Dev

Why does rsync fail to copy files from /sys in Linux?

分類Dev

Command to copy files to directory but only the ones that are not already there or have changed

分類Dev

Can rsync update a large file that has only changed partially without full retransmission?

分類Dev

Reducing apk size which has .so files

分類Dev

Which files are changed when GNU Parted shrinks a partition?

分類Dev

Ubuntu - how to copy files and folders which contain special characters

分類Dev

how to tell rsync to preserve time stamp on files when source tree has a mounted point

分類Dev

Rsync "finds" files that are implicitly excluded

分類Dev

How to include files that are excluded in an rsync

分類Dev

Check if a file has been changed

分類Dev

rsync password mismatch although it is a scp copy

分類Dev

Checkout deleted files, but not changed files, before commit

分類Dev

Computer cannot access webserver which changed IP

分類Dev

how to know which JTextField is changed in a set of fields

分類Dev

rsync isn't creating files or folders

分類Dev

Repetition of password while rsync-ing files?

分類Dev

rsync not setting the correct UID and GID on destination files

分類Dev

RxJava - Observable which emits items which are new or changed

分類Dev

React: Get initialstate after state has changed

分類Dev

Angular 2 - Expression has changed after it was checked

分類Dev

Tkinter detect when OptionMenu selection has changed

分類Dev

Why has changed both sides of equation in java?

分類Dev

How to update the view after the model has changed?

分類Dev

Counting how many times variable has changed

分類Dev

Has SQL changed very much from 2011

分類Dev

Resetting the background color of jtextfield that has been changed

分類Dev

AngularJS wait unitl variable has changed

Related 関連記事

  1. 1

    Rsync copy only changed files; ignore file modification time stamps

  2. 2

    rsync has been interrupted - copy from beginning

  3. 3

    Why does rsync fail to copy files from /sys in Linux?

  4. 4

    Command to copy files to directory but only the ones that are not already there or have changed

  5. 5

    Can rsync update a large file that has only changed partially without full retransmission?

  6. 6

    Reducing apk size which has .so files

  7. 7

    Which files are changed when GNU Parted shrinks a partition?

  8. 8

    Ubuntu - how to copy files and folders which contain special characters

  9. 9

    how to tell rsync to preserve time stamp on files when source tree has a mounted point

  10. 10

    Rsync "finds" files that are implicitly excluded

  11. 11

    How to include files that are excluded in an rsync

  12. 12

    Check if a file has been changed

  13. 13

    rsync password mismatch although it is a scp copy

  14. 14

    Checkout deleted files, but not changed files, before commit

  15. 15

    Computer cannot access webserver which changed IP

  16. 16

    how to know which JTextField is changed in a set of fields

  17. 17

    rsync isn't creating files or folders

  18. 18

    Repetition of password while rsync-ing files?

  19. 19

    rsync not setting the correct UID and GID on destination files

  20. 20

    RxJava - Observable which emits items which are new or changed

  21. 21

    React: Get initialstate after state has changed

  22. 22

    Angular 2 - Expression has changed after it was checked

  23. 23

    Tkinter detect when OptionMenu selection has changed

  24. 24

    Why has changed both sides of equation in java?

  25. 25

    How to update the view after the model has changed?

  26. 26

    Counting how many times variable has changed

  27. 27

    Has SQL changed very much from 2011

  28. 28

    Resetting the background color of jtextfield that has been changed

  29. 29

    AngularJS wait unitl variable has changed

ホットタグ

アーカイブ