Re: [DNG] Living Dangerously (was: Review of documentation needed)

2021-09-24 Thread spiralofhope
On Thu, 23 Sep 2021 17:16:21 +
g4sra via Dng  wrote:

> A rookie sysadmin mistake is to take backups but never ever do a test
> restore to ensure they are OK.

Can confirm.

I had a backup persistency file which felt "old" when I tried using it.

Backups seemed to be going impressively fast; suspiciously fast.

I finally figured out that it wasn't because it was a huge file that
was being skipped, but that it wasn't ever being backed up /
overwritten in the first place.

Of course its size wouldn't change, but apparently a persistency file
doesn't get its modification time changed when it's written-within.  I
never would have guessed..
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] Living Dangerously (was: Review of documentation needed)

2021-09-23 Thread g4sra via Dng
> g4sra via Dng wrote:
> 

> > I opt to live dangerously..(shove an '-r' in there too if you feel like it)
> > $ rm -i .* *
> > this way you can delete illegitimate entries without hacking the filesystem.
> 

> That is definitely dangerous indeed.
I wasn't exaggerating, what is life without a little excitement occasionally.
A rookie sysadmin mistake is to take backups but never ever do a test restore 
to ensure they are OK.
Using this command may provide you with that opportunity to perform a real 
restore from backup :)

> For example if for whatever
> reason one happens to have "-f" as a file name then it will override
> the "-i" listed as a command line option and then all files will be
> deleted without question.
> 

> $ mkdir /tmp/testdir
> $ cd /tmp/testdir
> $ touch ./-f .foo foo
> $ echo rm -i .* *
> rm -i . .. .foo -f foo
> $ rm -i .* *
> rm: cannot remove '.': Is a directory
> rm: cannot remove '..': Is a directory
> $ ll -a
> -rw-rw-r-- 1 rwp rwp 0 Sep 22 14:57 -f
> drwxrwxr-x 2 rwp rwp 60 Sep 22 14:57 ./
> drwxrwxrwt 11 root root 760 Sep 22 14:57 ../
> 

> Where is .foo? Where is foo? There was no -i prompt. The -f file i
> still on disk and not removed? All correct behavior given the
> command as given.
> 

> When dealing with file globs like "" it is always better to prefix it
> with "./" as in "./" so as to avoid the first character having any
> possibility of matching a dash and being interpreted as an option.

Thanks Bob, I will ensure I use ./* in future :)

> You make your own luck! :-)
I disagree with that though...it should be "You make your own bad fortune"

> [[ I have seen people intentionally leave a -i file in their home
> directory so as to intentionally have rm * cause it to be interpreted
> as an option. I recommend not relying upon it though. ]]
I have seen a few pranks in my time but never came across that one.
The most annoying of which was on one particular academic system which would 
not let you complete your login until you had read all your new mail.
Some bright spark emailed everybody (including the sysadmin so he could not 
purge mail) a copy of the system spellchecker dictionary.

I doubt the following will ever be topped, also a fashion statement, if you 
know different please post to this new thread.
https://jaromil.dyne.org/journal/forkbomb_art.html

> 

> Bob


publickey - g4sra@protonmail.com - 0x42E94623.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng