OpenSolaris rsync install script

Posted by 4Aiur on 12/21/2010 in OpenSolaris |

OpenSolaris rsync install script #!/bin/bash # OpenSolaris rsync installer # Created by 4Aiur on 2010-12-21. # define function check_rsync_config () { if [ ! -d /opt/local/etc/rsync/ ]; then mkdir -p /opt/local/etc/rsync/ fi if [ ! -f /opt/local/etc/rsync/rsyncd.conf ]; then cat > /opt/local/etc/rsync/rsyncd.conf /opt/local/etc/rsync/rsyncd.secrets /var/svc/manifest/network/rsync.xml RSYNC daemon EOF fi } rotate_log () { logadm -w rsync […]

Tags: ,

rsync模式匹配

Posted by 4Aiur on 03/31/2010 in SysAdmin |

rsync模式匹配 今天有一个同步数据的小问题,需要把一些符合特定日期的文件保存到另外一个目录,使用shell也很容易实现,之前没用rsync做过,今天顺便研究了一下rsync的实现方式,rsync是使用排除和取消排除的方法(诡异)。 为了实现递归,先写一个不排除的规则–include="*/" 再写一个希望保存文件的规则–include="2009022[78]" 最后写上排除所有的规则–exclude="*" 组合以上3个选项实现了对特定文件的同步。 rsync -aruv –include=”*/” –include=”*2009022[78]*” –include=”*2009030[12]*” –exclude=”*” /source /destination # aruv比较常用 -a, –archive archive mode, equivalent to -rlptgoD -r, –recursive recurse into directories -u, –update update only (don’t overwrite newer files) -v, –verbose increase verbosity

Tags:

Copyright © 2010-2024 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.