{"id":64573,"date":"2024-09-07T03:01:00","date_gmt":"2024-09-06T17:01:00","guid":{"rendered":"https:\/\/65.254.95.247\/ITblog\/?p=64573"},"modified":"2024-09-06T16:01:49","modified_gmt":"2024-09-06T06:01:49","slug":"almalinux-dns-changeover-filezilla-sftp-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-dns-changeover-filezilla-sftp-tutorial\/","title":{"rendered":"AlmaLinux DNS Changeover FileZilla sftp Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-dns_changeover_filezilla_sftp.gif\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"AlmaLinux DNS Changeover FileZilla sftp Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-dns_changeover_filezilla_sftp.gif\" title=\"AlmaLinux DNS Changeover FileZilla sftp Tutorial\"  \/><\/a><p class=\"wp-caption-text\">AlmaLinux DNS Changeover FileZilla sftp Tutorial<\/p><\/div>\n<p>Another day, another piece of the puzzle changing <a target=\"_blank\" title='IP address information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/IP_address' rel=\"noopener\">IP address<\/a> web server references for the domain name <i>rjmprogramming.com.au<\/i> &#8230; ie. <a target=\"_blank\" title='Domain Name System information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/Domain_Name_System' rel=\"noopener\">DNS<\/a> changeover (like with <a title='AlmaLinux Landing Page WordPress Content Update Solution Tutorial' href='#allpwpcust'>AlmaLinux Landing Page WordPress Content Update Solution Tutorial<\/a>).<\/p>\n<p>All this information will be blas\u00e9 knowledge to many system operators out there, but a lot of us are not system operators, so we&#8217;ll outline what we see and find out here.<\/p>\n<p>Regular readers <a target=\"_blank\" title='FileZilla sftp\/ftp' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/filezilla' rel=\"noopener\">will know<\/a> we use and really like the great <a target=\"_blank\" title='FileZilla sftp\/ftp' href='https:\/\/filezilla-project.org\/' rel=\"noopener\">FileZilla<\/a> product to use for the first of &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" title='sftp information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/SSH_File_Transfer_Protocol' rel=\"noopener\">sftp<\/a> &#8230; Secure ftp &#8230;<\/li>\n<li><a target=\"_blank\" title='Secure Shell information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/Secure_Shell' rel=\"noopener\">ssh<\/a> &#8230; via (for us macOS) Terminal command line &#8230;<\/li>\n<li><a target=\"_blank\" title='cPanel information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/CPanel' rel=\"noopener\">cPanel<\/a><\/li>\n<\/ul>\n<p> &#8230; group of access methodologies to our web server here at rjmprogramming.com.au domain.  And, believe me, they are all used extensively around here, for many and various purposes.<\/p>\n<p>We had ssh sorted pretty easily for the two scenarios, because it&#8217;s use only involved IP addresses, the two, for us, that are concerned, but with sftp, at least for us, we find three scenarios of concern show at the end of this posting part, the last of which we&#8217;ll show you the creation of a connection mechanism to in configuring FileZilla, with today&#8217;s <a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-dns_changeover_filezilla_sftp.gif\" rel=\"noopener\">animated GIF tutorial picture presentation<\/a>, where no remembering of passwords was needed, and you&#8217;ll see us demonstrating &#8230;<\/p>\n<ul>\n<li>FileZilla (top left icon) SiteManager -&gt; Duplicate &#8230;<br \/>\n<img src='https:\/\/www.rjmprogramming.com.au\/ITblog\/filezilla_dns-centosduplicate.jpg'><\/img><br \/>\n &#8230; and &#8230;<\/li>\n<li>FileZilla SiteManager -&gt; Rename &#8230;<br \/>\n<img src='https:\/\/www.rjmprogramming.com.au\/ITblog\/filezilla_dns-centospostdnsuserename.png'><\/img><br \/>\n &#8230; talents<\/li>\n<\/ul>\n<p>!   Huh?!<\/p>\n<blockquote><p>\nHow so?!\n<\/p><\/blockquote>\n<p>Well, we&#8217;re glad you got that proxy to ask?!  <a target=\"_blank\" title='OpenSSH' href='https:\/\/www.google.com\/search?q=openssh&#038;sca_esv=b3b81d1d30ec7baa&#038;sca_upv=1&#038;rlz=1C5CHFA_enAU973AU973&#038;sxsrf=ADLYWIISiR676BkeBqlzUcPYJ8pdKlyNSA%3A1725585134568&#038;ei=7lbaZr63Ivif4-EPmoq24Aw&#038;ved=0ahUKEwi-5ubHka2IAxX4zzgGHRqFDcwQ4dUDCBA&#038;uact=5&#038;oq=openssh&#038;gs_lp=Egxnd3Mtd2l6LXNlcnAiB29wZW5zc2gyDhAAGIAEGJECGLEDGIoFMgsQABiABBiRAhiKBTIKEAAYgAQYQxiKBTILEAAYgAQYkQIYigUyChAAGIAEGEMYigUyChAAGIAEGEMYigUyCxAAGIAEGJECGIoFMgUQABiABDIFEAAYgAQyBRAAGIAESLQMUABYvwpwAHgBkAEAmAHFAaAB2AmqAQMwLje4AQPIAQD4AQGYAgegAvgJwgIKECMYgAQYJxiKBcICBBAjGCfCAgsQABiABBixAxiDAcICERAuGIAEGLEDGNEDGIMBGMcBwgIIEAAYgAQYsQPCAhEQLhiABBixAxjHARiOBRivAcICFBAuGIAEGLEDGIMBGMcBGI4FGK8BwgILEC4YgAQY0QMYxwHCAg0QABiABBixAxhDGIoFwgIQEAAYgAQYsQMYQxiDARiKBcICChAAGIAEGBQYhwKYAwCSBwMwLjegB_9B&#038;sclient=gws-wiz-ser' rel=\"noopener\">OpenSSH<\/a> is used a lot, and for us &#8230;<\/p>\n<p><img src='https:\/\/www.rjmprogramming.com.au\/ITblog\/filezilla_dns-centospostdnsuseconnect.jpg'><\/img><\/p>\n<p> &#8230; with web server access arrangements, and these passwords end up being the crux of access controlled by keychains and OpenSSH protected files which also get transferred, in all probability during a migration phase where web server contents is transferred from one IP address to the new web server IP addresses.  For us, we relied on our web hoster, the great <a target=\"_blank\" title='Crazy Domains' href='http:\/\/www.crazydomains.com.au' rel=\"noopener\">Crazy Domains<\/a> to do this migration, and it all went so smoothly, thanks, but if you have those system operator skills you can do this yourself, if you decide to roll this way, or that way &#8230;<\/p>\n<p><video controls><source type=video\/mp4 src=https:\/\/www.rjmprogramming.com.au\/Mac\/rolling.mov><\/source><\/video><\/p>\n<p>Anyway, we&#8217;re here today nearing the time for the actual DNS changeover, mulling over the question &#8230;<\/p>\n<blockquote><p>\nBut what if we have forgotten something?!\n<\/p><\/blockquote>\n<p>We&#8217;re pretty sure there&#8217;ll be a bit of time where access back to the CentOS web server will be available to us, and we&#8217;d like an sftp access method for that purpose, corresponding to the last of the three FileZilla modes of connection below &#8230;<\/p>\n<ol>\n<li>Ongoing sftp connection to whatever IP address web server corresponds to rjmprogramming.com.au<\/li>\n<li>Before DNS changeover getting to proposed AlmaLinux web server<\/li>\n<li>After DNS changeover getting back to CentOS web server (just in case)<\/li>\n<\/ol>\n<p><b><i>Did you know?<\/i><\/b><\/p>\n<p>As a reminder to self, too, regarding the &#8220;actual DNS changeover&#8221; we have to remember to &#8220;undo&#8221; <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-apachephpmysql-wordpress-migration-tutorial\/' title='AlmaLinux Apache\/PHP\/MySql WordPress Migration Tutorial' rel=\"noopener\">AlmaLinux Apache\/PHP\/MySql WordPress Migration Tutorial<\/a>&#8216;s &#8230;<\/p>\n<blockquote>\n<ol>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li><\/li>\n<li>amend wp-config.php to add in code statement &#8230; thanks to <a target=\"_blank\" title='Great advice' href='https:\/\/docs.plesk.com\/en-US\/obsidian\/administrator-guide\/website-management\/wp-toolkit.73391\/' rel=\"noopener\">this great advice<\/a> &#8230;<br \/>\n<code><br \/>\ndefine('RELOCATE',true);<br \/>\n<\/code><br \/>\n &#8230; meaning URLs such as <i>https:\/\/[newIPaddressForRJMProgrammingIntoTheFuture]\/ITblog<\/i> just address data and software on [newIPaddressForRJMProgrammingIntoTheFuture] proposed new AlmaLinux9 web server (rather than ducking off to <i>https:\/\/www.rjmprogramming.com.au\/ITblog\/<\/i> or <i>https:\/\/[oldIPaddressForRJMProgrammingFromTheNearFuturePast]\/ITblog\/<\/i>)\n<\/li>\n<li><\/li>\n<li>in WordPress admin section General Settings make sure both WordPress Address (URL) and Site Address (URL) get mapped to  &#8230;<br \/>\n<code><br \/>\n<i>https:\/\/[newIPaddressForRJMProgrammingIntoTheFuture]\/ITblog<\/i><br \/>\n<\/code><br \/>\n &#8230; during our migration phase, at least\n<\/li>\n<li><\/li>\n<\/ol>\n<\/blockquote>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/new-almalinux-landing-page-wordpress-content-update-solution-tutorial\/' rel=\"noopener\">New AlmaLinux Landing Page WordPress Content Update Solution Tutorial<\/a>.<\/p-->\n<hr>\n<p id='allpwpcust'>Previous relevant <a target=\"_blank\" title='AlmaLinux Landing Page WordPress Content Update Solution Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-landing-page-wordpress-content-update-solution-tutorial\/' rel=\"noopener\">AlmaLinux Landing Page WordPress Content Update Solution Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/crontab_curl_and_now_command_line_php_landing_page_wordpress_blog_post_content_almaLlnux_updates.gif\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"AlmaLinux Landing Page WordPress Content Update Solution Tutorial\" src=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/crontab_curl_and_now_command_line_php_landing_page_wordpress_blog_post_content_almaLlnux_updates.gif\" title=\"AlmaLinux Landing Page WordPress Content Update Solution Tutorial\"  \/><\/a><p class=\"wp-caption-text\">AlmaLinux Landing Page WordPress Content Update Solution Tutorial<\/p><\/div>\n<p>As with yesterday&#8217;s <a title='MySql Watchdog Migration Transition Solution Tutorial' href='#mswmtst'>MySql Watchdog Migration Transition Solution Tutorial<\/a>, and it&#8217;s &#8230;<\/p>\n<ul>\n<li>crontab and curl &#8220;MySql Watchdog&#8221; basis &#8230; we also, around here, use &#8230;<\/li>\n<li>crontab and curl &#8220;Landing Page Daily Updates Regarding WordPress Blog Posting Content&#8221;<\/li>\n<\/ul>\n<p> &#8230; so that going to the RJM Programming Landing Page can glean the latest WordPress Blog content.<\/p>\n<p>During our &#8220;pre AlmaLinux&#8221; &#8220;pre DNS changeover&#8221; period, we&#8217;ve been doing two lots of WordPress Post &#8220;CMS style&#8221; textarea blog posting sessions for each daily new blog posting.  We&#8217;ve got a WordPress Blog with permalinks set to a variant of the blog posting title, and between the two versions &#8230;<\/p>\n<ul>\n<li>that part of a URL to get to this content remains the same (phew!) but the POST_ID becomes unreliable as a guaranteed th<strike>a<\/strike>ing &#8230; the least worriesome aspect, against &#8230;<\/li>\n<li>the Landing Page dropdowns for new, but soon to be the DNS IP address need to be populated via WordPress Blog MySql based data, via a tutorial_options.php piece of inhouse PHP which needs to change in a few ways &#8230;\n<ol>\n<li>references to what used to be &#8220;mysql_&#8221; style PHP calls now need to be transferred to equivalent &#8220;mysql<font color=blue>i<\/font>_&#8221; ones (and thanks to <a target=\"_blank\" href='https:\/\/stackoverflow.com\/questions\/16531252\/replacement-for-deprecated-function-mysql-connect' title='php - Replacement for deprecated function mysql_connect - Stack Overflow' rel=\"noopener\">php &#8211; Replacement for deprecated function mysql_connect &#8211; Stack Overflow<\/a> here, regarding great advice) where, as well as the  <font color=blue>i<\/font> change, for all but &#8230;<br \/>\n<font color=purple>$link<\/font> = mysql<font color=blue>i<\/font>_connect($hostname, $username, $password);<br \/>\nmysql<font color=blue>i<\/font>_num_rows($res)<br \/>\nmysql<font color=blue>i<\/font>_fetch_row($res)<br \/>\nmysql<font color=blue>i<\/font>_close(<font color=purple>$link<\/font>)<br \/>\n &#8230; references, for our PHP code, which used mysql<font color=blue>i<\/font>_select_db(<font color=purple>$link<\/font>, $dbname) and mysql<font color=blue>i<\/font>_query(<font color=purple>$link<\/font>,$qry) and mysql<font color=blue>i<\/font>_errno(<font color=purple>$link<\/font>) &#8230; we needed that extra first argument of the mysql<font color=blue>i<\/font> connection value &#8230; changes that reminded us, a tad, of how to go from a CSS Selector to a Javascript DOM by getting rid of _ and just to the right of where that was, capitalize that character, thinking<\/li>\n<li>rethink any $_GET[] or $_POST[] arrangements into $argc (and <font color=blue>$argv[1] argument<\/font>) based logic &#8230;<br \/>\n&lt;?php<br \/>\n<code><br \/>\n $index = \"index\";<br \/>\n <font color=blue>if (isset($argc)) {<br \/>\n    if ($argc >= 2) {<br \/>\n    if ($argv[1] != \"mobile\") {<br \/>\n    $index = $argv[1];<br \/>\n    }<br \/>\n    }<br \/>\n } else <\/font>if (isset($_GET['index'])) {<br \/>\n    $index = $_GET['index'];<br \/>\n } else if (isset($_POST['index'])) {<br \/>\n    $index = $_POST['index'];<br \/>\n }<br \/>\n<\/code><br \/>\n?&gt;<br \/>\n &#8230; so that &#8230;<\/p>\n<table style=font-size:8px;>\n<tr>\n<th>AlmaLinux<\/th>\n<th>CentOS<\/th>\n<\/tr>\n<tr>\n<td>cd ~rjmprogr\/public_html\/PHP; php tutorial_options.php<\/td>\n<td>curl ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/tutorial_options.php<\/td>\n<\/tr>\n<tr>\n<td>cd ~rjmprogr\/public_html\/PHP; php tutorial_options.php mobile<\/td>\n<td>curl ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/tutorial_options.php?mobile=mobile<\/td>\n<\/tr>\n<tr>\n<td>cd ~rjmprogr\/public_html\/PHP; php tutorial_options.php slideshow<\/td>\n<td>curl ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/tutorial_options.php?index=slideshow<\/td>\n<\/tr>\n<\/table>\n<p> &#8230; componentry into &#8220;ksh -c &#8220;[commands]&#8221; within a crontab regime &#8230; becomes the go &#8230; remember our <a target=\"_blank\" title='PHP Mode of Use tutorials' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mode-of-use' rel=\"noopener\">PHP &#8220;Modes of Use&#8221; tutorials<\/a>?\n<\/li>\n<li>\n<\/ol>\n<\/li>\n<li>similarly but with less bother, even than above, is recent-posts-2.php &#8230;<br \/>\n<table style=font-size:8px;>\n<tr>\n<th>AlmaLinux<\/th>\n<th>CentOS<\/th>\n<\/tr>\n<tr>\n<td>cd ~rjmprogr\/public_html\/PHP; php recent-posts-2.php<\/td>\n<td>curl ht<font color=black>tp<\/font>:\/\/www.rjmprogramming.com.au\/recent-posts-2.php<\/td>\n<\/tr>\n<\/table>\n<\/li>\n<\/ul>\n<p> &#8230; got the functionality going on our AlmaLinux soon to be the DNS IP address environment.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/new-mysql-watchdog-migration-transition-solution-tutorial\/' rel=\"noopener\">New MySql Watchdog Migration Transition Solution Tutorial<\/a> ...<\/p>\n\n\n\n\n\n<hr>\n\n\n\n\n\n<p id='mswmtst'>Previous relevant <a target=\"_blank\" title='MySql Watchdog Migration Transition Solution Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/mysql-watchdog-migration-transition-solution-tutorial\/' rel=\"noopener\">MySql Watchdog Migration Transition Solution Tutorial<\/a> is shown below.<\/p>\n\n\n\n[caption id=\"\" align=\"alignnone\" width=\"220\" caption=\"MySql Watchdog Migration Transition Solution Tutorial\"]<a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/dns_taken_into_account.gif\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"MySql Watchdog Migration Transition Solution Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/dns_taken_into_account.gif\" title=\"MySql Watchdog Migration Transition Solution Tutorial\"  \/><\/a>[\/caption]\n\n\n\n<p>Onto yesterday's <a title='MySql Watchdog Migration Transition Preparations Tutorial' href='#mswmtpt'>MySql Watchdog Migration Transition Preparations Tutorial<\/a>, yes, with Korn Shell scripting, thanks to the advice from <a target=\"_blank\" href='https:\/\/stackoverflow.com\/questions\/41060027\/how-to-use-nslookup-in-bash-to-verify-is-dns-is-configured-properly' title='How to use nslookup in bash to verify is DNS is configured properly?' rel=\"noopener\">How to use nslookup in bash to verify is DNS is configured properly?<\/a> and <a target=\"_blank\" href='https:\/\/stackoverflow.com\/questions\/13322485\/how-to-get-the-primary-ip-address-of-the-local-machine-on-linux-and-os-x' title='bash - How to get the primary IP address of the local machine on Linux and OS X? - Stack Overflow' rel=\"noopener\">bash - How to get the primary IP address of the local machine on Linux and OS X? - Stack Overflow<\/a> ...<\/p>\n\n\n\n<code>\n#!\/bin\/ksh\n# will_the_real_rjmprogramming_com_au_holler.ksh\n <br \/>\nnsl=\"`<a target=\"_blank\" title='nslookup information from ComputerHope' href='https:\/\/www.computerhope.com\/nslookup.htm' rel=\"noopener\">nslookup<\/a> rjmprogramming.com.au`\";\nmyip=\"`<a target=\"_blank\" title='ifconfig information from ComputerHope' href='https:\/\/www.computerhope.com\/unix\/uifconfi.htm' rel=\"noopener\">ifconfig<\/a> | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'`\";\nif [ \"`echo ${nsl} | grep -c ${myip}`\" != \"0\" ]; then\n if [ -d '\/home\/rjmprogr\/public_html\/wordpress\/' -a \"$1\" = \"doit\" ]; then\n  <font color=blue>echo y > \/home\/rjmprogr\/public_html\/wordpress\/mysql_needs.attention\n  chmod 777 \/home\/rjmprogr\/public_html\/wordpress\/mysql_needs.attention<\/font>\n else\n  echo \"yes\";\n fi\n exit;\nfi\nif [ -d '\/home\/rjmprogr\/public_html\/wordpress\/' -a \"$1\" = \"doit\" ]; then\n  echo \"\";\nelse \n  echo \"no\";\nfi\nexit;\n<\/code>\n\n\n\n<p> ... we can now \"play dead\" (by taking those <font color=blue>blue codelines<\/font>, which also appear in the MySql Watchdog, and now, instead, have ...\n\n<code>\n  if [ \"2\" != \"4\" ] ; then\n  ksh \/etc\/init.d\/will_the_real_rjmprogramming_com_au_holler.ksh doit\n  else \n  <font color=blue>echo y > \/home\/rjmprogr\/public_html\/wordpress\/mysql_needs.attention\n  chmod 777 \/home\/rjmprogr\/public_html\/wordpress\/mysql_needs.attention<\/font>\n  fi\n<\/code>\n\n\n\n<p> ...) regarding web servers whose IP address do not match the DNS looked up for <i>rjmprogramming.com.au<\/i> as a domain, with that \"attention seeking\" <i>\/home\/rjmprogr\/public_html\/wordpress\/mysql_needs.attention<\/i> file creation that our MySql Watchdog works off as the basis to swing into action ... more reliable than ...<\/p>\n\n\n\n\n\n<div style='display:inline-block;vertical-align:text-bottom;width:80%;height:600px;background:linear-gradient(rgba(255,255,255,0.0),rgba(255,255,255,0.0)),URL(\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/nala_watchdog_techniques.jpg);background-size:contain;background-repeat:no-repeat;'>\n\n<blockquote style='background-color:rgba(255,255,255,0.2);margin-top:270px;display:inline-block;vertical-align:text-bottom;opacity:1.0;text-shadow: -1px 1px 1px #952dff;'>\nNala!   Would you please get off the bed and attend to MySql having just fallen over ... pretty pleeeaaaassseee!\n<\/blockquote>\n\n\n<\/div>\n\n\n\n<!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/mysql-watchdog-migration-transition-solution-tutorial\/' rel=\"noopener\">MySql Watchdog Migration Transition Solution Tutorial<\/a>.<\/p-->\n<hr>\n<p id='mswmtpt'>Previous relevant <a target=\"_blank\" title='MySql Watchdog Migration Transition Preparations Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/mysql-watchdog-migration-transition-preparations-tutorial\/' rel=\"noopener\">MySql Watchdog Migration Transition Preparations Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/etcinitd_populating.gif\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"MySql Watchdog Migration Transition Preparations Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/nala_the_watchdog.jpg\" title=\"MySql Watchdog Migration Transition Preparations Tutorial\"  \/><\/a><p class=\"wp-caption-text\">MySql Watchdog Migration Transition Preparations Tutorial<\/p><\/div>\n<p>When we commented, in <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-apachephpmysql-wordpress-migration-tutorial\/' title='AlmaLinux Apache\/PHP\/MySql WordPress Migration Tutorial' rel=\"noopener\">AlmaLinux Apache\/PHP\/MySql WordPress Migration Tutorial<\/a> &#8230;<\/p>\n<blockquote cite='https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-apachephpmysql-wordpress-migration-tutorial\/'><p>\nYes, we&#8217;re migrating again <font size=1>(as we were talking about with <a title='Apache\/PHP\/MySql Web Hosting Website Migration ssh Tutorial' href='#a\/php\/mswhwmt'>Apache\/PHP\/MySql Web Hosting Website Migration ssh Tutorial<\/a>)<\/font>, though as you read this blog posting, if hot off the press here on 19\/7\/2024, we&#8217;ll not have transferred the DNS over yet, which we&#8217;ll outline the reasons for into the future.  But, today, we&#8217;re excited to outline some steps after &#8230;\n<\/p><\/blockquote>\n<p> &#8230; it was, mainly, regarding our MySql Watchdog ( <a target=\"_blank\" title='Korn Shell' href='https:\/\/en.wikipedia.org\/wiki\/KornShell' rel=\"noopener\">korn shell<\/a> scripting in the Linux Apache\/PHP\/MySql web server \/etc\/init.d scripts called via <a target=\"_blank\" title='crontab information from computerhope ... thanks' href='http:\/\/www.computerhope.com\/jargon\/c\/cron.htm' rel=\"noopener\">crontab<\/a> ) that concerned us most.  Why (Nala getting distracted, ever since <a title='MySql Down Thinking Followup Tutorial' href='#msdtft'>MySql Down Thinking Followup Tutorial<\/a> &#8230; or &#8230;)?<\/p>\n<p>Well, understandably our <a target=\"_blank\" title='Crazy Domains' href='http:\/\/www.crazydomains.com.au' rel=\"noopener\">Crazy Domains<\/a> web hosts were kind enough to &#8230;<\/p>\n<ul>\n<li>take on the migration &#8230; thanks &#8230; and not, just blithely &#8230;<\/li>\n<li>make any &#8220;old scripting&#8221; assumptions ( ie. we came across the new web server&#8217;s \/etc\/init.d folder as empty (and \/etc\/rc.d\/init.d folder, for your <a target=\"_blank\" title='AlmaLinux' href='https:\/\/almalinux.org\/' rel=\"noopener\">AlmaLinux<\/a> Apache2 <a target=\"_blank\" title='Daemon information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Daemon_(computing)' rel=\"noopener\">daemon process<\/a> folder arrangements not empty, but missing our own tailored scripting (and that scripting and our crontabbing used \/etc\/init.d mentions) &#8230; so &#8230;) &#8230; especially any to do with anything even resembling &#8230;<\/li>\n<li>crontab &#8230; nor, heaven forbid &#8230;<\/li>\n<li>curl &#8230; (the use of which, up to now, we&#8217;ve only ever combined with argument URLs that mentioned rjmprogramming.com.au rather than any numerical <a target=\"_blank\" title='IP address information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/IP_address' rel=\"noopener\">IP address<\/a> &#8230; hence, our concerns) &#8230; scripting being helped out by crontab &#8230; that had any personal tailoring ( ie. a <i>crontab -l<\/i><br \/>\n # showed default AlamaLinux arrangements only<\/li>\n<\/ul>\n<p>This can be very powerful stuff, and you could, during a period before the <a target=\"_blank\" title='Domain Name System information from Wikipedia, thanks' href='https:\/\/en.wikipedia.org\/wiki\/Domain_Name_System' rel=\"noopener\">DNS<\/a> changeover, if you had a matching crontab situation happening, having two watchdogs on two different IP addresses (only one of which is pointed to proper DNS rjmprogramming.com.au arrangements  trying to pick up a MySql service, and though only one would get through picking up the true rjmprogramming.com.au MySql service, the other would, at the very least, be doing superfluous activity because of the way we scripted it.  We scripted for &#8230;<\/p>\n<ul>\n<li>one DNS arrangement for the one IP address related to rjmprogramming.com.au &#8230; rather than &#8230;<\/li>\n<li>one DNS arrangement for the one IP address related to rjmprogramming.com.au and another IP address being readied for a future DNS rearrangement that it will map to &#8230; and after that &#8230;<\/li>\n<li>one DNS arrangement where that new IP address can newly become the DNS for rjmprogramming.com.au and another obsolete (but still having a working crontab happening) IP address awaits a decommission<\/li>\n<\/ul>\n<p>That is the power, and also the worry, regarding how <a target=\"_blank\" title='Linux or unix curl information from computerhope' href='http:\/\/www.computerhope.com\/unix\/curl.htm' rel=\"noopener\">curl<\/a> and crontab can be such useful Linux web server tools!<\/p>\n<p>For number 3 scenario, perhaps we can be quick decommissioning, but we imagine we&#8217;ll want to have another test period after the DNS changeover.  We&#8217;ll see.  Anyway, on the road towards solutions we&#8217;re pretty sure a first step is &#8230;<\/p>\n<ul>\n<li>before thinking of starting up any &#8220;inhouse scripting componentry&#8221; crontab schedulings on the new IP address web server &#8230;<\/li>\n<li>populate our empty \/etc\/init.d &#8230; with &#8230;<\/li>\n<li>matching script content and permissions and ownership as is (and then, was) happening on the current (but soon to be decommissioned) IP address web server<\/li>\n<\/ul>\n<p>This transfer of scripts is not suitable for our <a target=\"_blank\" title='FileZilla sftp\/ftp' href='https:\/\/filezilla-project.org\/' rel=\"noopener\">FileZilla<\/a> sftp transferring arrangements, and we do not feel like tackling any big shake up of arrangements here.<\/p>\n<p>But, we ended up with a zipping and unzipping methodology that went like &#8230;<\/p>\n<ul>\n<li>pick a folder that is hidden to the public (for both IP addresses) but that your Linux administration user (in our case &#8220;root&#8221;) can get to and our FileZilla web server user (in our case &#8220;rjmprogr&#8221;) can plonk to and from, for us, that being (notice, regarding Apache, no &#8220;public_html&#8221; mention) &#8230; \/home\/rjmprogr<\/li>\n<li>for current, but soon to be decommissioned IP address &#8230; ssh login &#8230; cd \/etc\/init.d &#8230; zip \/home\/rjmprogr\/etcinitd.zip *<\/li>\n<li>use relevant FileZilla on current, but soon to be decommissioned IP address setup to copy this back to your local operating system, ours being macOS &#8230;<\/li>\n<li>use relevant FileZilla on new, but soon to be the DNS IP address setup to copy this local operating system etcinitd.zip over to \/home\/rjmprogr<\/li>\n<li>for new, but soon to be the DNS IP address &#8230; ssh login &#8230; cd \/etc\/init.d &#8230; unzip \/home\/rjmprogr\/etcinitd.zip *<\/li>\n<li>if happy ( via &#8230; ls -l \/etc\/init.d\/* &#8230; checking and comparing between IP addresses ), for current, but soon to be decommissioned IP address &#8230; ssh login &#8230; rm -f \/home\/rjmprogr\/etcinitd.zip  # or do this via appropriate FileZilla session<\/li>\n<li>if happy ( via &#8230; ls -l \/etc\/init.d\/* &#8230; checking and comparing between IP addresses ), for new, but soon to be the DNS IP address &#8230; ssh login &#8230; rm -f \/home\/rjmprogr\/etcinitd.zip  # or do this via appropriate FileZilla session<\/li>\n<\/ul>\n<p> &#8230; that we were really happy with.<\/p>\n<p>For a small number of script files, though, an <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/etcinitd_populating.gif\" rel=\"noopener\">animated GIF presentation<\/a> we&#8217;ve provided (and don&#8217;t you just hate it when you only get the knack of it near the end of the job &#8230; sheeesh!) you might want to use &#8230;<\/p>\n<ul>\n<li>open two macOS Terminal windows side by side (and not overlapping) &#8230;<\/li>\n<li>left one has ssh login to current, but soon to be decommissioned IP address &#8230; cd \/etc\/init.d<\/li>\n<li>right one has ssh login to new, but soon to be the DNS IP address &#8230; cd \/etc\/init.d<\/li>\n<li>for each ( mainly *.*sh for us ) (korn shell usually for us) script of interest (we&#8217;ll call thesc.ksh below) &#8230;\n<ol>\n<li># no return key press below &#8230;<\/li>\n<li>left % <i>cat thesc.ksh<\/i><\/li>\n<li># you might want to use Terminal app&#8217;s Edit -&gt; Copy the highlighted &#8220;thesc.ksh&#8221; to help (via Terminal app&#8217;s Edit -&gt; Paste) with &#8230;<\/li>\n<li>right % <i>vi thesc.ksh<\/i><\/li>\n<li>at left, as necessary, press Return key<\/li>\n<li>at left highlight from the bottom ( probably &#8220;<font color=blue>exit<\/font>&#8221; ) up to the top ( probably &#8220;<font color=blue>#!\/bin\/ksh<\/font>&#8221; ) and use Terminal app&#8217;s Edit -&gt; Copy<\/li>\n<li>at right, as necessary, press Return key<\/li>\n<li>at right, if content already there, use appropriate &lt;esc<sub>ape<\/sub>&gt;999dd command to clear to nothing then &#8230;<\/li>\n<li>at right, press &#8220;i&#8221; key (for Insert) &#8230;<\/li>\n<li>at right, use Terminal app&#8217;s Edit -&gt; Paste<\/li>\n<li>at right, maybe press &lt;esc<sub>ape<\/sub>&gt;w (to have an interim look) ahead of &#8230;<\/li>\n<li>at right, maybe press &lt;esc<sub>ape<\/sub>&gt;wq!<\/li>\n<\/ol>\n<\/li>\n<li>attend to any ownership (research <i>chown<\/i> and <i>chgrp<\/i>) or file permission (research <i>chmod<\/i>) mismatches you would tweak to via ls -l \/etc\/init.d\/* &#8230; checking and comparing between IP addresses<\/li>\n<li>and consider only leaving &#8220;inhouse scripting&#8221; in \/etc\/init.d on new, but soon to be the DNS IP address here, for now (and into the future rewrite scripting for \/etc\/rc.d\/init.d reuse)<\/li>\n<\/ul>\n<p><img decoding=\"async\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/etcinitd_populating.gif\"><\/img><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/mysql-watchdog-migration-transition-preparations-tutorial\/' rel=\"noopener\">MySql Watchdog Migration Transition Preparations Tutorial<\/a>.<\/p-->\n<hr>\n<p id='msdtft'>Previous relevant <a target=\"_blank\" title='MySql Down Thinking Followup Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/mysql-down-thinking-followup-tutorial\/' rel=\"noopener\">MySql Down Thinking Followup Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/wp_dependent.jpg\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"MySql Down Thinking Followup Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/wp_dependent.jpg\" title=\"MySql Down Thinking Followup Tutorial\"  \/><\/a><p class=\"wp-caption-text\">MySql Down Thinking Followup Tutorial<\/p><\/div>\n<p>When we discussed <a title='Linux Watchdog Primer Tutorial' href='#lwpt'>Linux Watchdog Primer Tutorial<\/a> in that very generic fashion below, we were being that &#8230; generic.  Today we turn to specifics in that regard.   On the rjmprogramming.com.au domain we use a &#8230;<\/p>\n<ul>\n<li>(software) watchdog which checks for the health of the MySql Service, and if not healthy, restore it to health &#8230; which is all fine and good from the point of view of the domain rjmprogramming.com.au &#8230; but depending on what the user was doing we could &#8230;<\/li>\n<li>code for intervention within the MySql using piece of software, and writing out the database error to the webpage, and present alternative navigation<\/li>\n<\/ul>\n<p> &#8230; on the understanding with that latter thought, that we put into play today for a WordPress 4.1.1 blog, we realized we needed to intervene in &#8230;<\/p>\n<p><code><br \/>\n[DocumentRoot]\/ITblog\/wp-includes\/functions.php<br \/>\n<\/code><\/p>\n<p> &#8230; in <b>the emboldened code intervention<\/b> as below &#8230;<\/p>\n<p><code><br \/>\n<br \/>\n\t\/\/ Otherwise, be terse.<br \/>\n\tstatus_header( 500 );<br \/>\n\tnocache_headers();<br \/>\n    <b>$ubitsare=explode(\"\/\", str_replace(\"\/?p=\",\"\",$_SERVER['REQUEST_URI']));<br \/>\n    if (sizeof($ubitsare) &gt; 2) {<br \/>\n    if (strpos(str_replace(\"-\",\"%20\",$ubitsare[2]), \"slideshow.htm\") === false) {<br \/>\n    header(\"Location: \/slideshow.html?title=\" . explode(\"&\", str_replace(\"-\",\"%20\",str_replace(\"\/?p=\",\"\",$ubitsare[2]))[0]));<br \/>\n\texit;<br \/>\n\t} else {<br \/>\n\theader( 'Content-Type: text\/html; charset=utf-8' );<br \/>\n\t}<br \/>\n    } else {<\/b><br \/>\n\theader( 'Content-Type: text\/html; charset=utf-8' );<br \/>\n\t<b>}<\/b><br \/>\n?&gt;<br \/>\n&lt;!DOCTYPE html&gt;<br \/>\n&lt;html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\"&lt;?php if ( is_rtl() ) echo ' dir=\"rtl\"'; ?&gt;&gt;<br \/>\n&lt;head&gt;<br \/>\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=utf-8\" \/&gt;<br \/>\n\t&lt;title&gt;&lt;?php _e( 'Database Error' ); ?&gt;&lt;\/title&gt;<br \/>\n<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body&gt;<br \/>\n\t&lt;h1&gt;&lt;?php _e( 'Error establishing a database connection'); ?&gt;&lt;\/h1&gt;<br \/>\n&lt;\/body&gt;<br \/>\n&lt;\/html&gt;<br \/>\n&lt;?php<br \/>\n\tdie();<br \/>\n}<br \/>\n<br \/>\n<\/code><\/p>\n<p> &#8230; where the redirection to \/slideshow.html effectively <a target=\"_blank\" title='Cut to the Chase' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/?s=Cut%20to%20the%20Chase' rel=\"noopener\">&#8220;Cuts to the Chase&#8221;<\/a> for the gist of that blog posting you never got to, as MySql is currently down.<\/p>\n<p>Notice how specific the actions can be when you write code &#8220;dependent&#8221; on another software component, as distinct from the &#8220;watchdog&#8221; approach we often want to be &#8220;independent&#8221; in its thinking.<\/p>\n<p>Guess this begs the question?  How did we work out where to intervene?  We just got to folders on the rjmprogramming.com.au web server with the WordPress (Codex) software and went (showing you the one that yielded the nicest result for us) &#8230;<\/p>\n<p><code><br \/>\npwd \/\/ and we are at [DocumentRoot]\/ITblog<br \/>\ncd wp-includes<br \/>\nfgrep 'Error establishing a database connection' *.php<br \/>\n<\/code><\/p>\n<hr>\n<p id='lwpt'>Previous relevant <a target=\"_blank\" title='Linux Watchdog Primer Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/linux-watchdog-primer-tutorial\/' rel=\"noopener\">Linux Watchdog Primer Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/Watchdog.jpg\" rel=\"noopener\"><img decoding=\"async\" style=\"float:left; border: 15px solid pink;\" alt=\"Linux Watchdog Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/Linux\/Watchdog\/Watchdog.jpg\" title=\"Linux Watchdog Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">Linux Watchdog Primer Tutorial<\/p><\/div>\n<p style=\"font-size: 60px; color: pink;\">&#8220;<\/p>\n<p>Do you have a computer operational problem?   What the &#8230; what is that humanoid on about?    Well, is there a computer operation you have to do routinely, to fix an ongoing problem, that relies on your personal intervention that, one day, you&#8217;d like to not have to worry about, or better still &#8230; you usually intervene, but would like a backup approach should you get sick and can&#8217;t do it &#8230; here&#8217;s where you need <strike>Fido<\/strike> a <a target=\"_blank\" title='watchdog information from Wikipedia ... thanks' href='http:\/\/en.wikipedia.org\/wiki\/Watchdog_timer' rel=\"noopener\">watchdog<\/a><\/p>\n<blockquote><p>&#8230; am not recommending a Golden Retriever, unless you want your process licked rather than attended to?  (had you forgotten this was a question, <strike>Cedric<\/strike> <strike>Linux<\/strike> Nala)? &#8230; <\/p><\/blockquote>\n<p> oh, moi?)<\/p>\n<p style=\"font-size: 60px; color: pink;\">&#8220;<\/p>\n<p>Why is bellybutton fluff <a target=\"_blank\" title='blue' href='http:\/\/www.abc.net.au\/science\/k2\/lint\/' rel=\"noopener\">blue<\/a>?     But we digress, or at Buckingham Palace one digresses.<\/p>\n<p>Right, back at watchdogs, there are schools of thought &#8230;<\/p>\n<ol>\n<li>The process is down for too long and we need to do something about it, because customers are leaving<\/li>\n<li>If you need a watchdog to save your bacon, then (clearly you&#8217;re not with it, because the dog&#8217;s eaten the bacon and) there is something else fundamentally wrong or something you do not understand, which is what you really should resolve, either way<\/li>\n<\/ol>\n<p>My view is that, if the underlying process would take years to understand or if it is written in legacy code, I&#8217;d go more with the former idea, especially as there is delight in creating a really good watchdog (training one?  not so easy) &#8230; it can be really hard to do &#8230; for this reason cannot give code here really, because there is no &#8220;out of the box&#8221; that is a responsible approach to advise &#8230; you have to study the issue and cut it into its components, unit test the solutions to the components of your watchdog solution, and retest with the interactions of those components.   However, this is a coding enthusiast&#8217;s view, and is a bit short-sighted, perhaps.   In any case, what will save the day is that this decision will probably be made for you by an operations expert, if you work in a large organization.<\/p>\n<p>Some other watchdog considerations should be &#8230;<\/p>\n<ol>\n<li>Is the attempt to automate the solution that the watchdog will provide technically possible &#8230; may not be?!<\/li>\n<li>We can resolve it with personal intervention &#8230; can the watchdog simulate each step of the human intervention?   If so, go for that approach if possible.<\/li>\n<li>Be very careful of approaches that involve mouse clicks, as they are quite often relative to too many other environmental issues &#8230; try to restrict the watchdog solution to command line\/scripting\/keyboard ideas &#8230; on Windows, <a target=\"_blank\" title='AutoHotKey' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=AutoHotKey#content' rel=\"noopener\">AutoHotKey<\/a> is an excellent recording program of interest (would recommend just using it for keyboard recordings, if using it for a watchdog &#8230; by the way, tomorrow (<a target=\"_blank\" title='tomorrow arrived today' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=4296' rel=\"noopener\">tomorrow arrived today<\/a>) we do a tutorial showing you how to create an AutoHotKey terminate-and-stay-resident program on Windows).<\/li>\n<li>Have we identified the real intervention points?   If not, you might succeed some of the time, but not all the time, and you may cause damage on those times when you have made some assumptions, with your incomplete understanding.<\/li>\n<\/ol>\n<p>Here is an example.   You have an overnight batch process run, and it falls over at a certain point, and you get paged at 3 or 4 (it&#8217;s bound to be AM).   It has been tentatively decided you might want to create a watchdog &#8230; what are some considerations &#8230;<\/p>\n<ol>\n<li>What do log files tell me?   Find out.<\/li>\n<li>Is it a single thing that is missing that would resolve the problem once and for all?   If yes,  well, you know not to deviate from this one thing &#8230; ignore ideas below.<\/li>\n<li>Of the few problems, is it worth proceeding with the watchdog idea, because the number of separate issues can often cause a factor of ten more complication issue points, and maybe you should stick with human intervention.<\/li>\n<li>Break the watchdog problem into these problem issues as a separate unit-testable piece of scripting code (or whatever your watchdog solution entails) &#8230; test each for success &#8230; retest for their interaction with each other (ie. that they don&#8217;t interfere with each other).<\/li>\n<\/ol>\n<p>The title of this tutorial mentions Linux but generic thinking like above covers other operating system thought patterns, but there are some Linux (or Unix) tools that are great Linux commands that we should point out &#8230; thanks to Hscripts.com and CyberCiti.biz for this &#8230;<\/p>\n<ol>\n<li><a target=\"_blank\" title='crontab' href='http:\/\/www.hscripts.com\/tutorials\/linux-commands\/crontab.html' rel=\"noopener\">crontab<\/a> ( eg. *\/5 * * * * Username \/path\/to\/command    <em># where \/path\/to\/command  gets run by Username every five minutes &#8230; arranged via crobtab -e )<\/em> &#8230; for Windows, equivalent would be <a target=\"_blank\" title='Task Schedular in Windows Primer Tutorial' href='http:\/\/www.rjmprogramming.com.au\/wordpress\/?p=1297' rel=\"noopener\">Task Schedular in Windows Primer Tutorial<\/a><\/li>\n<li><a target=\"_blank\" title='nohup' href='http:\/\/www.hscripts.com\/tutorials\/linux-commands\/nohup.html' rel=\"noopener\">nohup<\/a><\/li>\n<li><a target=\"_blank\" title='bg' href='http:\/\/www.hscripts.com\/tutorials\/linux-commands\/bg.html' rel=\"noopener\">bg<\/a><\/li>\n<li><a target=\"_blank\" title='nice' href='http:\/\/www.cyberciti.biz\/faq\/change-the-nice-value-of-a-process\/' rel=\"noopener\">nice<\/a><\/li>\n<\/ol>\n<p>And here are some of the practicalities of a watchdog &#8230;<\/p>\n<ol>\n<li>Where does it run?   If at more than one place, consider each place separately.   If it runs on more than one computer, then clearly this is important.   Does the directory and file permissions allow the watchdog to run, but do not allow other users to misuse it?  (Please say yes here.)   A generic thing about crontab or nohup (or Windows <a target=\"_blank\" title='start' href='http:\/\/www.computerhope.com\/starthlp.htm' rel=\"noopener\">start<\/a>) scripting arrangements are that you should not assume the environments of these processes is the same as your current running command line process &#8230; you should write as if you have just logged on and have done nothing &#8230; so just about the first decision of the script is to &#8220;cd&#8221; itself to the proper place where it was designed to run.<\/li>\n<li>Which user(s) (on whichever computer(s)) can run it?<\/li>\n<li>When does it run?   If the solution is uncomplicated enough, maybe you can use a pre-emptive approach.   For example, you know the problem is to do with a file missing when a non-critical process fails but later on that file is looked for, then why not pre-emptively get the watchdog to create that file (with default data) ahead of the process run crash point time.<\/li>\n<li>As part of the question above, does one subprocess need to end before another starts?   If yes, you need to intervene in such a way that that process architecture remains, and you need to work out an independent way for your independent watchdog to step in, at the correct time, and take over the same task, as required.   But if it gets to this, don&#8217;t you understand the underlying process well enough to have a crack at doing the &#8220;real&#8221; solution (for all time)?    Have a think, now, and keep checking in on the issue?<\/li>\n<li>You need to log the workings of the watchdog both for information and for further research which might help in achieving a &#8220;real&#8221; solution (without the watchdog) further down the track.<\/li>\n<\/ol>\n<p>So why was this posting called a tutorial?    Well, there&#8217;s some homework.   You see there are these Daleks, and we sort of need to know when they&#8217;re going to invade Earth again, and Dr Who is not always available, so, was wondering, if it wouldn&#8217;t be too inconvenient &#8230; if you wouldn&#8217;t mind writing that watchdog to detect a Dalek invasion and shoo them off &#8230; 6 hours &#8230; <a target=\"_blank\" title='Daleks' href='https:\/\/www.youtube.com\/watch?v=rjmdTL-kYOc' rel=\"noopener\">okay<\/a>?<\/p>\n<p style=\"font-size: 60px; color: pink;\">&#8220;<\/p>\n<p>Woofsky!<\/p>\n<p style=\"font-size: 60px; color: pink;\">&#8220;<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d4495' onclick='var dv=document.getElementById(\"d4495\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"http:\/\/www.rjmprogramming.com.au\/wordpress\/?s=networking#content\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d4495' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d44247' onclick='var dv=document.getElementById(\"d44247\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/wordpress\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d44247' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d64579' onclick='var dv=document.getElementById(\"d64579\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/linux\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64579' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d64592' onclick='var dv=document.getElementById(\"d64592\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/dns\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64592' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d64618' onclick='var dv=document.getElementById(\"d64618\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mode-of-use\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64618' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d64573' onclick='var dv=document.getElementById(\"d64573\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/sftp\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d64573' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Another day, another piece of the puzzle changing IP address web server references for the domain name rjmprogramming.com.au &#8230; ie. DNS changeover (like with AlmaLinux Landing Page WordPress Content Update Solution Tutorial). All this information will be blas\u00e9 knowledge to &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/almalinux-dns-changeover-filezilla-sftp-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,25,33,37],"tags":[53,4855,195,249,270,2195,327,347,2007,629,1908,4896,2269,1564,1129,1190,4894,1319,4221,1411,1456],"class_list":["post-64573","post","type-post","status-publish","format-standard","hentry","category-elearning","category-networking","category-software","category-tutorials","tag-access","tag-almalinux","tag-centos","tag-configuration","tag-cpanel","tag-crazy-domains","tag-did-you-know","tag-dns","tag-filezilla","tag-ip-address","tag-keychain","tag-openssh","tag-operator","tag-password","tag-sftp","tag-ssh","tag-system-operator","tag-tutorial","tag-web-hoster","tag-web-server","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64573"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=64573"}],"version-history":[{"count":9,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64573\/revisions"}],"predecessor-version":[{"id":64586,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/64573\/revisions\/64586"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=64573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=64573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=64573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}