{"id":1208,"date":"2022-03-27T16:48:38","date_gmt":"2022-03-27T16:48:38","guid":{"rendered":"https:\/\/jamj.org\/?p=1208"},"modified":"2022-03-27T16:48:38","modified_gmt":"2022-03-27T16:48:38","slug":"gnu-flock","status":"publish","type":"post","link":"https:\/\/jamj.org\/index.php\/2022\/03\/27\/gnu-flock\/","title":{"rendered":"Gnu &#8211; Flock"},"content":{"rendered":"\n<p>This is an interesting command. Have you ever wanted to be sure that just one instance of your app\/script is running at the same time? Then, <em>flock<\/em> is your tool. The sintax is as follows:<\/p>\n\n\n\n<p><code>flock [options] file|directory command [arguments]<\/code><\/p>\n\n\n\n<p>Lets see an example: <\/p>\n\n\n\n<p><code>flock \/home\/user\/lockfile htop<\/code><\/p>\n\n\n\n<p>This runs <em>htop<\/em> and uses a generated file in <em>home\/user<\/em> named lockfile to control the locking. If you try to run the same command, you will not be able to run <em>htop<\/em> again until the first instance finish. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is an interesting command. Have you ever wanted to be sure that just one instance of your app\/script is running at the same time? Then, flock is your tool. The sintax is as follows: flock [options] file|directory command [arguments] Lets see an example: flock \/home\/user\/lockfile htop This runs htop and uses a generated file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1208","post","type-post","status-publish","format-standard","hentry","category-gnu"],"_links":{"self":[{"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/posts\/1208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/comments?post=1208"}],"version-history":[{"count":0,"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/posts\/1208\/revisions"}],"wp:attachment":[{"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/media?parent=1208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/categories?post=1208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jamj.org\/index.php\/wp-json\/wp\/v2\/tags?post=1208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}