Langsung ke konten utama

rsync

While tar over ssh is ideal for making remote copies of parts of a filesystem, rsync is even better suited for keeping the filesystem in sync between two machines. Typically, tar is used for the initial copy, and rsync is used to pick up whatever has changed since the last copy. This is because tar tends to be faster than rsync when none of the destination files exist, but rsync is much faster than tar when there are only a few differences between the two filesystems.

To run an rsync over ssh, pass it the -e switch, like this:

root@neova:~# rsync -ave ssh greendome:/home/neova /home/neova-backup

Notice the trailing / on the file spec from the source side (on greendome.) On the source specification, a trailing / tells rsync to copy the contents of the directory, but not the directory itself. To include the directory as the top level of whatever is being copied, leave off the /:

root@village:~# rsync -ave ssh bcnu:/home/six .

This will keep a copy of the ~root/six/ directory on village in sync with whatever is present on bcnu:/home/six/.

By default, rsync will only copy files and directories, but not remove them from the destination copy when they are removed from the source. To keep the copies exact, include the --delete flag:

six@neova:~/public_html# rsync -ave ssh --delete greendome:~one/reports .

Now when old reports are removed from ~one/reports/ on greendome, they're also removed from ~six/public_html/reports/ on jammer, every time this command is run. If you run a command like this in cron, leave off the v switch. This will keep the output quiet (unless rsync has a problem running, in which case you'll receive an email with the error output).

Using ssh as your transport for rsync traffic has the advantage of encrypting the data over the network and also takes advantage of any trust relationships you already have established using ssh client keys. For keeping large, complex directory structures in sync between two machines (especially when there are only a few differences between them), rsync is a very handy (and fast) tool to have at your disposal.

Komentar

Postingan populer dari blog ini

Mall Baru di Kubu Raya Pontianak

Akan hadir  Mall of borneo  yang akan menjadi mal terbesar di Kabupaten Kubu Raya, Kalimantan Barat, tepatnya Jl. Arteri Supadio Kubu Raya, dekat dengan batas kota Pontianak. Mall dengan konsep  kesatuan yang memberikan investasi yang sangat produktif.  Mal dengan luas bangunan 233 ribu m2 yang terdiri dari 5 lantai dan bangunan yang akan digunakan hotel. Pembangunan Mall of Borneo yang akan ada selain mall, hotel dan kompleks ruko serta taman buatan dilengkapi dengan berbagai fasilitas yang modern. Dukungan datang dari pemda setempat, terbukti pada saat Ground Breaking, Gubernur Kalimantan Barat mendukung penuh pembangunan Mall of borneo dalam kata sambutannya "Kubu Raya ini sangat potential untuk sektor perdagangan dan jasa serta investasi lainnya sehingga daerah ini terus berkembang dan maju setelah kota Pontianak." Selain itu Bupati Kubu Raya juga  memberikan pe ndapatnya, "Ini akan menjadi ikon baru bagi Kubu Raya, kalau selama ini masyarakat Kubu Raya b

Swiss-Belhotel Pontianak

Located on Jalan Teuku Umar Pontianak, Swiss - Belhotel Pontianak stand nearly 23 storeys above 4600 square meters of land will certainly also have bed rooms 350 rooms of various classes built with the concept of MICE Business Hotel with premium class. Swiss - Belhotel Pontianak Facilities Swiss - Belhotel Pontianak designed for multifunctional, the swimming pool will be attached to the top storey, so guests may enjoy the wonder of the city from above. Other features, including Business Center that will facilitate your work, swimming pool, gym, meeting rooms, lobbying, to cafes and restaurants. In addition you will have 10 other spaces that could be useful for conferences, exhibitions and appointments.

Samarinda Global City

Big Mall adalah proyek mal baru di Jalan Untung Suropati, Samarinda Kalimantan Timur. Dalam satu kompleks Samarinda Global City dilengkapi dengan apartemen yg berjumlah 40-an lantai akan dibangun di atas luas tanah sekitar 6 hektare. Samarinda Global City dikembangkan menjadi tiga tahap, yakni  apartemen , hotel,  pembangunan mal,  dan gedung perkantoran atau disebut Samarinda Global City (Sam Go Ci) .  Salah satu proyek Mall yang ada di Kalimantan ini, dengan desain baru yang lebih futuristik dan modern dirancang untuk merangkul semua golongan pengusaha, juga akan mendukung kemajuan usaha lokal, seperti produk khas Samarinda, baik jenis penganan maupun kerajinan tangan dengan tertata rapi sesuai penggolongan.  Konsep hiburan dan lifestyle yang cocok untuk keluarga maupun kawula muda yang menyediakan fasilitas fitness center, game center, accessories center, fashion, ice skating, food court selera nusantara dan internasional. Sumber :  Kaltim Post