- عن "يسقط يسقط ابن تيمية"
- شهادتى عن اللى حصل فى مقر الاخوان فى اسكندرية النهارده
- My presentation in SFD2012, FOSS Entrepreneurship
- Spirula Systems was the defender of opposition websites in the Egyptian revolution
- مبروك لتونس
- This blog is back to live
- My presentation in SFD2010
- Dilbert and the management matrix
- وزارة الأوقاف: لا يجوز الجهاد ضد اسرائيل
- تجهيز قافلة مساعدات غذائية لغزة اليوم من اسكندرية
howto setup an rsync server (debian/ubuntu)
rsync is a great tool for synchronizing 2 directories (or files) either one of them is remote and the other is local, or 2 local folders (it doesn't support synchronizing 2 remote servers, yet). the power of rsync comes from that it doesn't transfer anything unless it detects that it's changes since last run. moreover, it transfer the changes in files only (unless you specified otherwise), and it can even compress files before sending which makes it ideal for continuous backups and mirroring.
to use rsync, you have 2 options. either to start rsync daemon which handles the connections, or use it through ssh tunnel. each way has its positives and negatives. rsync daemon is indeed faster in intiating connections cause it doesn't exchange keys or encrypt data, which makes its load on the server is less too. the overhead of keeping the daemon alive is so small that you can simply ignore. the ssh tunnel doesn't require a special configuration on the server side, but you must have ssh access to the server, which means that you can't grant anonymouse access to your data. the main positive of ssh tunnel is that data is sent through the secure tunnel and can't be sniffed.
- to connect through ssh tunnel: first, you'll need to install rsync:
apt-get install rsync
then you are ready, just issue the command directly
rsync -avz -e ssh [email protected]:/remote/dir /this/dir/
remember to check the permissions for ssh user on the remote server. (the remote server must have rsync installed too).
- to connect through rsync server:
- install rsync:
apt-get install rsync
- create "
/etc/rsyncd.conf
" and put the following in it:
max connections = 1
log file = /var/log/rsync.log
timeout = 300
[cache]
comment = Cache of Mongrels
path = /usr/local/cache
read only = no
list = yes
uid = nobody
gid = nogroup
#auth users = mongrel
list = yes
hosts allow = 127.0.0.0/8 192.168.0.0/24
#secrets file = /etc/rsyncd.secrets
note that the first few lines are global (for all modules) and the other one is specital for the public module.
comment the last two lines to grant anonymouse access, note that you can still limit by ip/netmask - create ''/etc/rsyncd.secret'', and put the usernames and passwords for the ones who can access rsync, in the form of username:password , note that passwords are saved here as clear text. so don't forget to chmod it to 400 to keep the passwords somehow safe
- make rsync to start as daemon:
edit ''/etc/inetd.conf'' and put the following line in the end:
rsync stream tcp nowait root /usr/bin/rsync rsync --daemon - voila, you are done, test your settings by typing:
rsync rsync://your_ip_or_domain_name/
this should list the modulesrsync rsync://your_ip_or_domain_name/public
this shuold list the files in your 'public' modulesrsync -avz rsync://your_ip_or_domain_name/public
synchronozing should start the transfer now.
don't forget to check the rsync man page to check what flags do you really need.
- install rsync:
لم استطع تنفيذ البرنامج
هل باستطاعتك نقل الترجمة لاى العربية مع توضيح كيفية عمل
rsync -avz -e ssh [email protected]:/remote/dir /this/dir/
/etc/rsyncd.conf
اسف
نقل الترجمة الى العربية يحتاج منى وقت يصعب توفيره..
بالنسبة للأمر المذكور، فقط أكتبه كما هو مع تغيير remoteuser, remotehost, /remote/dir /this/dir/ للقيم الصحيحة عندك..
من المفترض أن يعمل مباشرة
Post new comment