{"id":9592,"date":"2005-10-20T07:01:38","date_gmt":"2005-10-20T04:01:38","guid":{"rendered":"https:\/\/mamchenkov.net\/wordpress\/2005\/10\/20\/synchronizing-directories-with-perl-and-ssh\/"},"modified":"2005-10-20T07:01:38","modified_gmt":"2005-10-20T04:01:38","slug":"synchronizing-directories-with-perl-and-ssh","status":"publish","type":"post","link":"https:\/\/mamchenkov.net\/wordpress\/2005\/10\/20\/synchronizing-directories-with-perl-and-ssh\/","title":{"rendered":"Synchronizing directories with Perl and SSH"},"content":{"rendered":"<!-- google_ad_section_start -->\n<p>For a while now I have been using ICQ both at home and at work.  Instead of having two different copies of data or running ICQ remotely, I was  simply copying all data files over between these two locations.  <code>rsync<\/code> with <code>scp<\/code> were doing the job just fine.  The problem emerged when I started to use ICQ on more than two machines (two machines in the office and one at home).  I had to always figure out where is the latest copy of my data and distribute it from there to all the other locations.  After doing it manually for just a couple of time bored me to death and I decided to write a script.<\/p>\n<p>I started off with a very specific script that was only meant to copy my ICQ back and forth, but quickly realized that it can be generalized to copy any set of directories.  So, here it is &#8211; <a href='\/wordpress\/wp-content\/sync_dirs.perl' title='sync_dirs.pl'>sync_dirs.pl<\/a>.<\/p>\n<p>This script accepts and requires only one parameter &#8211; directory to synchronize. You can define a few shortcuts for frequently used directories inside the script.  Locations are also defined inside the script.  Since this piece of code uses <code>Net::SSH<\/code> and <code>Net::SCP<\/code>, the current limitation is that you must have ssh configured to authorize with keys, not passwords.  The good news, is that you need only one location to be able to access all the others.  The most recent copy of data will be copied over to this central location and from there distributed to all the other machines.<\/p>\n<!-- google_ad_section_end -->\n","protected":false},"excerpt":{"rendered":"<!-- google_ad_section_start -->\n<p>For a while now I have been using ICQ both at home and at work. Instead of having two different copies of data or running ICQ remotely, I was simply copying all data files over between these two locations. rsync with scp were doing the job just fine. The problem emerged when I started to &hellip; <a href=\"https:\/\/mamchenkov.net\/wordpress\/2005\/10\/20\/synchronizing-directories-with-perl-and-ssh\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Synchronizing directories with Perl and SSH<\/span><\/a><\/p>\n<!-- google_ad_section_end -->\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_links_to":"","_links_to_target":""},"categories":[1,18],"tags":[616,36],"keyring_services":[],"class_list":["post-9592","post","type-post","status-publish","format-standard","hentry","category-general","category-programming","tag-filesystem","tag-perl"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[{"id":8054,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/10\/14\/on-instant-messaging\/","url_meta":{"origin":9592,"position":0},"title":"On instant messaging","author":"Leonid Mamchenkov","date":"October 14, 2004","format":false,"excerpt":"Pretty often I get complains from certain people that it is impossible to chat with me online in real-time. The thing is, I do use only two protocols for instant messaging: ICQ and IRC. IRC is by far my favourite one. I like joining a channel or two for a\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":8432,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/01\/06\/kopete-saga\/","url_meta":{"origin":9592,"position":1},"title":"Kopete saga","author":"Leonid Mamchenkov","date":"January 6, 2005","format":false,"excerpt":"I have spent a good part of today trying to configure Kopete to my likings. Kopete is an instant messaging client that supports a number of protocols - ICQ, IRC, Yahoo, MSN, Jabber, and others. It is also integrated into KDE, which I am using for a few years now.\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":10958,"url":"https:\/\/mamchenkov.net\/wordpress\/2007\/12\/06\/passing-messages-between-google-talk-and-icq\/","url_meta":{"origin":9592,"position":2},"title":"Passing messages between Google Talk and ICQ","author":"Leonid Mamchenkov","date":"December 6, 2007","format":false,"excerpt":"Recently Google announced that GTalk users can now communicate with AIM users.\u00c2\u00a0 I didn't mention it here and, in fact, didn't pay it much attention since I don't use AOL Instant Messenger.\u00c2\u00a0 Why do I suddenly come back to this announcement?\u00c2\u00a0 Well, because my memory played a Grand Failure Play\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9078,"url":"https:\/\/mamchenkov.net\/wordpress\/2005\/06\/15\/telling-gnu-arch-the-truth\/","url_meta":{"origin":9592,"position":3},"title":"Telling Gnu Arch the truth","author":"Leonid Mamchenkov","date":"June 15, 2005","format":false,"excerpt":"Yet another problem (and solution) that I've stumbled across while using Gnu Arch. We have two branches in our archive: program--vendor--0.1 and program--local--0.1. Vendor's version has all the source files in SomeDirectory, while our local version has all source files in somedir. Except for the name and few local changes,\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7560,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/06\/09\/p800-updates\/","url_meta":{"origin":9592,"position":4},"title":"P800 updates","author":"Leonid Mamchenkov","date":"June 9, 2004","format":false,"excerpt":"It has been a long time since I checked the SonyEricsson P800 scene. Meanwhile there were plenty software updates and a lot more media content published. I've spent a good deal of today downloading all sorts of sounds and pictures, testing new software products and updating the old ones. Out\u2026","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7448,"url":"https:\/\/mamchenkov.net\/wordpress\/2004\/04\/20\/ftp-watchpl\/","url_meta":{"origin":9592,"position":5},"title":"ftp-watch.pl","author":"Leonid Mamchenkov","date":"April 20, 2004","format":false,"excerpt":"This script helps in monitoring of remote FTP server for changes in files and directories. During the first run a recursive listing will be saved to a local file, which will be updated on all consequtivee runs. Differences will be reported in GNU diff format. ftp-watch.pl","rel":"","context":"In &quot;All&quot;","block_context":{"text":"All","link":"https:\/\/mamchenkov.net\/wordpress\/category\/general\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/9592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/comments?post=9592"}],"version-history":[{"count":0,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/posts\/9592\/revisions"}],"wp:attachment":[{"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/media?parent=9592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/categories?post=9592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/tags?post=9592"},{"taxonomy":"keyring_services","embeddable":true,"href":"https:\/\/mamchenkov.net\/wordpress\/wp-json\/wp\/v2\/keyring_services?post=9592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}