Backup 程序

 

  
  
  
  
  1. https://github.com/netkiller/backup 
  2.   
  3.   
  4.  
  5. backup 
  6.  
  7. Backup Software 
  8.  
  9. Help 
  10. $ ./backup --help 
  11. Usage: backup [options] arg1 arg2 <task> 
  12.  
  13. Options: 
  14.   -h, --help            show this help message and exit 
  15.   -f FILE, --file=FILE  write report to FILE 
  16.   -q, --quiet           don't print status messages to stdout 
  17.   --config=CONFIG       Read configuration options from file. 
  18.   --task=TASK           task config file. 
  19.   --schedule=SCHEDULE   schedule config file. 
  20.   -v, --version         print version number 
  21.   -d, --daemon          run as daemon 
  22.   --logfile=LOGFILE     logs file. 
  23.  
  24.   arg1: 
  25.     arg1: task | schedule 
  26.  
  27.   arg2: 
  28.     arg2: list | run 
  29.  
  30.   Debug Options: 
  31.     --debug             Print debug information 
  32. New Task 
  33. [www] 
  34. policy=mirror 
  35. from=/www/www.example.com/* 
  36. to=/tmp/www 
  37. exclude=.svn 
  38. include=* 
  39.  
  40. [database
  41. policy=mysql 
  42. host=192.168.2.1 
  43. port=3306 
  44. user=www 
  45. password=123456 
  46. database=test 
  47. compress=gzip 
  48. to=/tmp 
  49. Run Task 
  50. $ ./backup task list 
  51. www 
  52. htdocs 
  53. database 
  54. New Schedule 
  55. $ ./backup schedule show weekly 
  56. www: True 
  57. images: False 
  58.  
  59. $ ./backup schedule show monthly 
  60. test: True 
  61. test1: True 
  62. test2: True 
  63. Run Schedule 
  64. $ backup schedule list 
  65. hourly 
  66. daily 
  67. weekly 
  68. monthly 
  69. Crontab Schedule 
  70. # m h  dom mon dow   command 
  71. 17 *    * * *   test -x /srv/sbin/backup || ( backup schedule run hourly ) 
  72. 25 6    * * *   test -x /srv/sbin/backup || ( backup schedule run daily ) 
  73. 47 6    * * 7   test -x /srv/sbin/backup || ( backup schedule run weekly ) 
  74. 52 6    1 * *   test -x /srv/sbin/backup || ( backup schedule run monthly ) 
  75.  
  76.  
  77. */30 * * * * /srv/sbin/backup task run www 

 

本文出自 “Netkiller 手札” 博客,转载请与作者联系!

你可能感兴趣的:(python,backup,netkiller)