差異處
這裏顯示兩個版本的差異處。
Both sides previous revision 前次修改 下次修改 | 前次修改 | ||
linux:backup:rsync_to_windows_cifs [2019/08/10 18:37] tony [How to?] |
linux:backup:rsync_to_windows_cifs [2019/08/11 01:12] tony [Problem] |
||
---|---|---|---|
行 2: | 行 2: | ||
====== Backup linux files to windows cifs ====== | ====== Backup linux files to windows cifs ====== | ||
===== Problem ===== | ===== Problem ===== | ||
+ | 我這台wiki http server是安裝在CentOS6上,資料之前我是使用dropbox做備份。前陣子將OS升級到6.10後,發現dropbox已經無法正常使用,也無法正常升級。拖了好一陣子,今天決定用傳統的rsync方法做備份,並且分享給大家。 | ||
===== How to? ===== | ===== How to? ===== | ||
+ | 我使用的方式context diagram如下:\\ | ||
+ | {{:linux:backup:my_linux_backup_with_rsync_and_dropbox.png|}}\\ | ||
+ | \\ | ||
+ | - 使用mount cifs將window backup server掛載到linux server的某個目錄。 | ||
+ | - 執行rsync把要備份的資料sync到掛載目錄上。 | ||
+ | - dropbox client會自動將最新資料上傳到dropbox server上。 | ||
+ | 備份腳本如下: | ||
<code bash> | <code bash> | ||
#!/bin/bash | #!/bin/bash | ||
行 20: | 行 27: | ||
umount ${mount_dir} | umount ${mount_dir} | ||
</code> | </code> | ||
+ | 最後是設定crontab,我設定每天3點做備份: | ||
+ | <code bash> | ||
+ | 0 3 * * * /opt/backup/backup_dockwiki.sh | ||
+ | </code> | ||
+ | |||
+ | 這個方法的最大壞處就是無法備份linux的檔案權限,不過我需要的只是資料,檔案權限目前不是我需要的部分。 | ||
===== Reference ===== | ===== Reference ===== | ||
* [[http://wiki.weithenn.org/cgi-bin/wiki.pl?smb-%E5%88%86%E4%BA%AB%E8%B3%87%E6%BA%90%E7%B5%A6Windows%E6%A9%9F%E5%99%A8|smb-分享資源給Windows機器]] | * [[http://wiki.weithenn.org/cgi-bin/wiki.pl?smb-%E5%88%86%E4%BA%AB%E8%B3%87%E6%BA%90%E7%B5%A6Windows%E6%A9%9F%E5%99%A8|smb-分享資源給Windows機器]] | ||
* [[https://blog.gtwang.org/linux/rsync-local-remote-file-synchronization-commands/Linux 使用 rsync 遠端檔案同步與備份工具教學與範例]] | * [[https://blog.gtwang.org/linux/rsync-local-remote-file-synchronization-commands/Linux 使用 rsync 遠端檔案同步與備份工具教學與範例]] | ||
+ | * [[http://linux.vbird.org/linux_basic/0430cron.php|鳥哥 - 例行性工作排程(crontab)]] | ||
+ | ===== ===== | ||
+ | ---- | ||
+ | \\ | ||
+ | ~~DISQUS~~ |