您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

rsnapshot.conf 8.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. #################################################
  2. # rsnapshot.conf - rsnapshot configuration file #
  3. #################################################
  4. # #
  5. # PLEASE BE AWARE OF THE FOLLOWING RULES: #
  6. # #
  7. # This file requires tabs between elements #
  8. # #
  9. # Directories require a trailing slash: #
  10. # right: /home/ #
  11. # wrong: /home #
  12. # #
  13. #################################################
  14. #######################
  15. # CONFIG FILE VERSION #
  16. #######################
  17. config_version 1.2
  18. ###########################
  19. # SNAPSHOT ROOT DIRECTORY #
  20. ###########################
  21. # All snapshots will be stored under this root directory.
  22. #
  23. snapshot_root /data/backup/
  24. # If no_create_root is enabled, rsnapshot will not automatically create the
  25. # snapshot_root directory. This is particularly useful if you are backing
  26. # up to removable media, such as a FireWire or USB drive.
  27. #
  28. #no_create_root 1
  29. #################################
  30. # EXTERNAL PROGRAM DEPENDENCIES #
  31. #################################
  32. # LINUX USERS: Be sure to uncomment "cmd_cp". This gives you extra features.
  33. # EVERYONE ELSE: Leave "cmd_cp" commented out for compatibility.
  34. #
  35. # See the README file or the man page for more details.
  36. #
  37. cmd_cp /bin/cp
  38. # uncomment this to use the rm program instead of the built-in perl routine.
  39. #
  40. cmd_rm /bin/rm
  41. # rsync must be enabled for anything to work. This is the only command that
  42. # must be enabled.
  43. #
  44. cmd_rsync /usr/bin/rsync
  45. # Uncomment this to enable remote ssh backups over rsync.
  46. #
  47. cmd_ssh /usr/bin/ssh
  48. # Comment this out to disable syslog support.
  49. #
  50. cmd_logger /usr/bin/logger
  51. # Uncomment this to specify the path to "du" for disk usage checks.
  52. # If you have an older version of "du", you may also want to check the
  53. # "du_args" parameter below.
  54. #
  55. #cmd_du /usr/bin/du
  56. # Uncomment this to specify the path to rsnapshot-diff.
  57. #
  58. #cmd_rsnapshot_diff /usr/bin/rsnapshot-diff
  59. # Specify the path to a script (and any optional arguments) to run right
  60. # before rsnapshot syncs files
  61. #
  62. #cmd_preexec /path/to/preexec/script
  63. # Specify the path to a script (and any optional arguments) to run right
  64. # after rsnapshot syncs files
  65. #
  66. #cmd_postexec /path/to/postexec/script
  67. # Paths to lvcreate, lvremove, mount and umount commands, for use with
  68. # Linux LVMs.
  69. #
  70. #linux_lvm_cmd_lvcreate /sbin/lvcreate
  71. #linux_lvm_cmd_lvremove /sbin/lvremove
  72. #linux_lvm_cmd_mount /bin/mount
  73. #linux_lvm_cmd_umount /bin/umount
  74. #########################################
  75. # BACKUP INTERVALS #
  76. # Must be unique and in ascending order #
  77. # i.e. hourly, daily, weekly, etc. #
  78. #########################################
  79. #retain hourly 6
  80. retain daily 7
  81. retain weekly 4
  82. retain monthly 12
  83. ############################################
  84. # GLOBAL OPTIONS #
  85. # All are optional, with sensible defaults #
  86. ############################################
  87. # Verbose level, 1 through 5.
  88. # 1 Quiet Print fatal errors only
  89. # 2 Default Print errors and warnings only
  90. # 3 Verbose Show equivalent shell commands being executed
  91. # 4 Extra Verbose Show extra verbose information
  92. # 5 Debug mode Everything
  93. #
  94. verbose 2
  95. # Same as "verbose" above, but controls the amount of data sent to the
  96. # logfile, if one is being used. The default is 3.
  97. #
  98. loglevel 3
  99. # If you enable this, data will be written to the file you specify. The
  100. # amount of data written is controlled by the "loglevel" parameter.
  101. #
  102. #logfile /var/log/rsnapshot.log
  103. # If enabled, rsnapshot will write a lockfile to prevent two instances
  104. # from running simultaneously (and messing up the snapshot_root).
  105. # If you enable this, make sure the lockfile directory is not world
  106. # writable. Otherwise anyone can prevent the program from running.
  107. #
  108. lockfile /var/run/rsnapshot.pid
  109. # By default, rsnapshot check lockfile, check if PID is running
  110. # and if not, consider lockfile as stale, then start
  111. # Enabling this stop rsnapshot if PID in lockfile is not running
  112. #
  113. #stop_on_stale_lockfile 0
  114. # Default rsync args. All rsync commands have at least these options set.
  115. #
  116. #rsync_short_args -a
  117. #rsync_long_args --delete --numeric-ids --relative --delete-excluded
  118. # ssh has no args passed by default, but you can specify some here.
  119. #
  120. #ssh_args -p 22
  121. # Default arguments for the "du" program (for disk space reporting).
  122. # The GNU version of "du" is preferred. See the man page for more details.
  123. # If your version of "du" doesn't support the -h flag, try -k flag instead.
  124. #
  125. #du_args -csh
  126. # If this is enabled, rsync won't span filesystem partitions within a
  127. # backup point. This essentially passes the -x option to rsync.
  128. # The default is 0 (off).
  129. #
  130. #one_fs 0
  131. # The include and exclude parameters, if enabled, simply get passed directly
  132. # to rsync. If you have multiple include/exclude patterns, put each one on a
  133. # separate line. Please look up the --include and --exclude options in the
  134. # rsync man page for more details on how to specify file name patterns.
  135. #
  136. #include ???
  137. #include ???
  138. #exclude ???
  139. #exclude ???
  140. # The include_file and exclude_file parameters, if enabled, simply get
  141. # passed directly to rsync. Please look up the --include-from and
  142. # --exclude-from options in the rsync man page for more details.
  143. #
  144. #include_file /path/to/include/file
  145. #exclude_file /path/to/exclude/file
  146. # If your version of rsync supports --link-dest, consider enable this.
  147. # This is the best way to support special files (FIFOs, etc) cross-platform.
  148. # The default is 0 (off).
  149. #
  150. #link_dest 0
  151. # When sync_first is enabled, it changes the default behaviour of rsnapshot.
  152. # Normally, when rsnapshot is called with its lowest interval
  153. # (i.e.: "rsnapshot hourly"), it will sync files AND rotate the lowest
  154. # intervals. With sync_first enabled, "rsnapshot sync" handles the file sync,
  155. # and all interval calls simply rotate files. See the man page for more
  156. # details. The default is 0 (off).
  157. #
  158. #sync_first 0
  159. # If enabled, rsnapshot will move the oldest directory for each interval
  160. # to [interval_name].delete, then it will remove the lockfile and delete
  161. # that directory just before it exits. The default is 0 (off).
  162. #
  163. #use_lazy_deletes 0
  164. # Number of rsync re-tries. If you experience any network problems or
  165. # network card issues that tend to cause ssh to crap-out with
  166. # "Corrupted MAC on input" errors, for example, set this to a non-zero
  167. # value to have the rsync operation re-tried
  168. #
  169. #rsync_numtries 0
  170. # LVM parameters. Used to backup with creating lvm snapshot before backup
  171. # and removing it after. This should ensure consistency of data in some special
  172. # cases
  173. #
  174. # LVM snapshot(s) size (lvcreate --size option).
  175. #
  176. #linux_lvm_snapshotsize 100M
  177. # Name to be used when creating the LVM logical volume snapshot(s).
  178. #
  179. #linux_lvm_snapshotname rsnapshot
  180. # Path to the LVM Volume Groups.
  181. #
  182. #linux_lvm_vgpath /dev
  183. # Mount point to use to temporarily mount the snapshot(s).
  184. #
  185. #linux_lvm_mountpath /path/to/mount/lvm/snapshot/during/backup
  186. ###############################
  187. ### BACKUP POINTS / SCRIPTS ###
  188. ###############################
  189. # LOCALHOST
  190. #backup /home/ localhost/
  191. #backup /etc/ localhost/
  192. #backup /usr/local/ localhost/
  193. #backup /var/log/rsnapshot localhost/
  194. #backup /etc/passwd localhost/
  195. #backup /home/foo/My Documents/ localhost/
  196. #backup /foo/bar/ localhost/ one_fs=1, rsync_short_args=-urltvpog
  197. #backup_script /usr/local/bin/backup_pgsql.sh localhost/postgres/
  198. # You must set linux_lvm_* parameters below before using lvm snapshots
  199. #backup lvm://vg0/xen-home/ lvm-vg0/xen-home/
  200. # EXAMPLE.COM
  201. #backup_script /bin/date "+ backup of example.com started at %c" unused1
  202. #backup root@example.com:/home/ example.com/ +rsync_long_args=--bwlimit=16,exclude=core
  203. #backup root@example.com:/etc/ example.com/ exclude=mtab,exclude=core
  204. #backup_script ssh root@example.com "mysqldump -A > /var/db/dump/mysql.sql" unused2
  205. #backup root@example.com:/var/db/dump/ example.com/
  206. #backup_script /bin/date "+ backup of example.com ended at %c" unused9
  207. # CVS.SOURCEFORGE.NET
  208. #backup_script /usr/local/bin/backup_rsnapshot_cvsroot.sh rsnapshot.cvs.sourceforge.net/
  209. # RSYNC.SAMBA.ORG
  210. #backup rsync://rsync.samba.org/rsyncftp/ rsync.samba.org/rsyncftp/
  211. backup_script /bin/date "+backup started at %c" | /usr/bin/tee date backup_start_date
  212. include_conf /etc/rsnapshot/user_backup.conf
  213. backup_script /bin/date "+backup ended at %c" | /usr/bin/tee date backup_end_date