{"id":5531,"date":"2015-04-27T18:29:47","date_gmt":"2015-04-27T08:29:47","guid":{"rendered":"http:\/\/nsrd.info\/blog\/?p=5531"},"modified":"2018-12-11T12:58:59","modified_gmt":"2018-12-11T02:58:59","slug":"basics-taking-a-turn-about-the-filesystem","status":"publish","type":"post","link":"https:\/\/nsrd.info\/blog\/2015\/04\/27\/basics-taking-a-turn-about-the-filesystem\/","title":{"rendered":"Basics &#8211; Taking a turn about the filesystem"},"content":{"rendered":"<blockquote><p>&#8220;Miss Eliza Bennet, let me persuade you to follow my example, and take a turn about the room. &#8212; I assure you it is very refreshing after sitting so long in one attitude.&#8221;<\/p>\n<p>Jane Austin: Pride and Prejudice.<\/p><\/blockquote>\n<p>The NetWorker&nbsp;<em>savegrp<\/em> command has a lot of different command line options, but one which falls into that useful-for-debugging category for me has always been the <i>-n<\/i> option. This allows you to invoke the save commands for a group (or a&nbsp;single client in the group) in&nbsp;<em>walk\/don&#8217;t do<\/em> mode.<\/p>\n<p>While filesystems have become considerably more capable at self-repair and resilient towards minor corruption, there was a time in the past where you could encounter&nbsp;an operating system crash as a result of attempting to access a particularly corrupt file or part of the filesystem. Backups, of&nbsp;course, want to walk all the filesystems (unless you direct them otherwise), and so being able to see&nbsp;<em>what<\/em> NetWorker might do during a backup was helpful to diagnose such issues. (Even if it meant one more crash.)<\/p>\n<p>These days, if&nbsp;a host being backed up by&nbsp;NetWorker via a filesystem agent gets a&nbsp;<em>lot<\/em> of changes during a day, you might simply be interested in seeing just how many files are going to be backed up.<\/p>\n<p>The command is pretty straight forward:<\/p>\n<pre># <strong>savegrp -nv <em>[-c client]<\/em> groupName<\/strong><\/pre>\n<p>For instance, consider the following execution:<\/p>\n<pre>[root@orilla ~]# <strong>savegrp -nv -c mondas Servers<\/strong>\n90528:savegrp: mondas:All level=incr\n7236:savegrp: Group will not limit job parallelism\n83643:savegrp: mondas:All started\nsavefs -s orilla -c mondas -g Servers -p -n -l full -R -v\nmondas:\/ level=incr, vers=pools, p=4\nmondas:\/d\/01 level=incr, vers=pools, p=4\nmondas:\/boot level=incr, vers=pools, p=4\nmondas:\/d\/backup level=incr, vers=pools, p=4\n90491:savegrp: mondas:All succeeded.\n83647:savegrp: Servers mondas:All See the file \/nsr\/logs\/sg\/Servers\/832077 for command output\n83643:savegrp: mondas:\/ started\nsave -s orilla -g Servers -n -LL -f - -m mondas -t 1430050510 -o MODIFIED_ASOF_TIME:timeval=1430050506;RENAMED_DIRECTORIES:index_lookup=on;BACKUPTIME:lookup_range=1429877707:1430050510; -l incr -W 78 -N \/ \/\n83643:savegrp: mondas:\/d\/01 started\nsave -s orilla -g Servers -n -LL -f - -m mondas -t 1430050508 -o MODIFIED_ASOF_TIME:timeval=1430050506;RENAMED_DIRECTORIES:index_lookup=on;BACKUPTIME:lookup_range=1429877710:1430050508; -l incr -W 78 -N \/d\/01 \/d\/01\n83643:savegrp: mondas:\/boot started\nsave -s orilla -g Servers -n -LL -f - -m mondas -t 1430050507 -o MODIFIED_ASOF_TIME:timeval=1430050506;RENAMED_DIRECTORIES:index_lookup=on;BACKUPTIME:lookup_range=1429877709:1430050507; -l incr -W 78 -N \/boot \/boot\n83643:savegrp: mondas:\/d\/backup started\nsave -s orilla -g Servers -n -LL -f - -m mondas -t 1430050509 -o MODIFIED_ASOF_TIME:timeval=1430050506;RENAMED_DIRECTORIES:index_lookup=on;BACKUPTIME:lookup_range=1429877708:1430050509; -l incr -W 78 -N \/d\/backup \/d\/backup\n77562:savegrp: job (832078) host: mondas savepoint: \/ had WARNING indication(s) at completion\n90491:savegrp: mondas:\/ succeeded.\n<span style=\"text-decoration: underline;\">83647:savegrp: Servers mondas:\/ See the file \/nsr\/logs\/sg\/Servers\/832078 for command output\n<\/span>90491:savegrp: mondas:\/boot succeeded.\n83647:savegrp: Servers mondas:\/boot See the file \/nsr\/logs\/sg\/Servers\/832080 for command output\n90491:savegrp: mondas:\/d\/01 succeeded.\n83647:savegrp: Servers mondas:\/d\/01 See the file \/nsr\/logs\/sg\/Servers\/832079 for command output\n90491:savegrp: mondas:\/d\/backup succeeded.\n83647:savegrp: Servers mondas:\/d\/backup See the file \/nsr\/logs\/sg\/Servers\/832081 for command output\n83643:savegrp: mondas:index started\nsave -s orilla -S -g Servers -n -LL -f - -m orilla -V -t 1429878349 -l 9 -W 78 -N index:147f6a46-00000004-5457fce2-5457fce1-0016b3a0-02efe8cc \/nsr\/index\/mondas\n128137:savegrp: Group Servers waiting for 1 jobs (0 awaiting restart) to complete.<\/pre>\n<pre>90491:savegrp: mondas:index succeeded.\n83647:savegrp: Servers mondas:index See the file \/nsr\/logs\/sg\/Servers\/832082 for command output\n* mondas:All savefs mondas: succeeded.\n* mondas:\/ suppressed 2038 bytes of output.<\/pre>\n<pre>...snip...<\/pre>\n<p>You&#8217;ll see there the output reaches a point where NetWorker tells you <em>&#8220;suppressed X bytes of output&#8221;<\/em>. That&#8217;s a protection mechanism for NetWorker to prevent savegroup completion notifications growing to massive sizes.&nbsp;However, because we&#8217;ve used the verbose option, the output&nbsp;<em>is<\/em> captured \u2013 it&#8217;s just directed to the appropriate log file for the group. In this case, the output (underlined above) tells me I can check out the file \/nsr\/logs\/sg\/Servers\/832078 to see the details of the root filesystem backup for the client&nbsp;<em>mondas<\/em>.<\/p>\n<p>Checking that file, I can see what files would have been backed up:<\/p>\n<pre>[root@orilla Servers]# <strong>more \/nsr\/logs\/sg\/Servers\/832078<\/strong>\n96311:save: Ignoring Parallel savestreams per saveset setting due to incompatibl\ne -n\/-E option(s)\n75146:save: Saving files modified since Sun Apr 26 22:15:06 2015\n\/var\/log\/rpmpkgs\n\/var\/log\/secure\n\/var\/log\/audit\/audit.log\n\/var\/log\/audit\/\n\/var\/log\/lastlog\n\/var\/log\/cron\n\/var\/log\/wtmp\n\/var\/log\/maillog\n\/var\/log\/\n\/var\/run\/utmp\n\/var\/run\/\n\/var\/lock\/subsys\/\n\/var\/lock\/\n\/var\/spool\/clientmqueue\/qft3QI22Tg020700\n\/var\/spool\/clientmqueue\/dft3QI22Tg020700\n\/var\/spool\/clientmqueue\/\n\/var\/spool\/cups\/tmp\/\n\/var\/spool\/cups\/\n\/var\/spool\/anacron\/cron.daily\n\/var\/spool\/anacron\/\n\/var\/spool\/<\/pre>\n<pre>...snip...<\/pre>\n<p>This command only works for filesystem backups&nbsp;performed by the core NetWorker agent.&nbsp;It&#8217;s not compatible for instance, with a database module or VBA \u2013 but regardless, it is the sort of debugging\/analysis tool you&nbsp;<em>should<\/em> be aware of.&nbsp;(Forewarned is forearmed, and forearmed is a lot of arms&#8230; Ahem.)<\/p>\n<p>Check out&nbsp;<em>savegrp -n<\/em> on a client\/group when you have time to familiarise yourself with how it works. It&#8217;s&nbsp;reasonably straightforward and is a good addition to your NetWorker utility belt.<\/p>\n<p><a href=\"https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2015\/04\/file-walk.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-5536\" src=\"https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2015\/04\/file-walk.jpg\" alt=\"file walk\" width=\"172\" height=\"600\" srcset=\"https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2015\/04\/file-walk.jpg 172w, https:\/\/nsrd.info\/blog\/wp-content\/uploads\/2015\/04\/file-walk-86x300.jpg 86w\" sizes=\"auto, (max-width: 172px) 100vw, 172px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;Miss Eliza Bennet, let me persuade you to follow my example, and take a turn about the room. &#8212; I&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[6,16],"tags":[1243,292,1223],"class_list":["post-5531","post","type-post","status-publish","format-standard","hentry","category-basics","category-networker","tag-basics","tag-debug","tag-savegrp"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pKpIN-1rd","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/5531","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/comments?post=5531"}],"version-history":[{"count":7,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/5531\/revisions"}],"predecessor-version":[{"id":7432,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/posts\/5531\/revisions\/7432"}],"wp:attachment":[{"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/media?parent=5531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/categories?post=5531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nsrd.info\/blog\/wp-json\/wp\/v2\/tags?post=5531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}