LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   Downloading revoke.crl from crl.cacert.org creates sequentially numbered files (https://www.linuxquestions.org/questions/linux-security-4/downloading-revoke-crl-from-crl-cacert-org-creates-sequentially-numbered-files-4175633506/)

tombro 07-07-2018 10:48 AM

Downloading revoke.crl from crl.cacert.org creates sequentially numbered files
 
While setting up sendmail, I downloaded the revoke.crl file from http://crl.cacert.org. To stay current, cron does this weekly.
I noticed that every time a file is downloaded, it gets incremented by one.
So, now I have revoke.crl, revoke.crl.1, revoke.crl.2, etc.
Should I delete revoke.crl before downloading a new one?
Any information as to what's happening would be welcome.

scasey 07-09-2018 01:52 AM

Can you show us the script that does the download, please?

tombro 07-09-2018 05:25 PM

This is the script run weekly:
Quote:

#!/usr/bin/bash
#
cd /etc/pki/tls/certs
wget http://crl.cacert.org/revoke.crl

scasey 07-09-2018 06:06 PM

From man wget: (emphasis added)
Code:

      -nc
      --no-clobber
          If a file is downloaded more than once in the same directory, Wget's behavior depends on a few options, including -nc.  In certain cases, the local file will be clobbered, or
          overwritten, upon repeated download.  In other cases it will be preserved.

          When running Wget without -N, -nc, -r, or -p, downloading the same file in the same directory will result in the original copy of file being preserved and the second copy being named
          file.1.  If that file is downloaded yet again, the third copy will be named file.2, and so on.
  (This is also the behavior with -nd, even if -r or -p are in effect.)  When -nc is
          specified, this behavior is suppressed, and Wget will refuse to download newer copies of file.  Therefore, ""no-clobber"" is actually a misnomer in this mode---it's not clobbering
          that's prevented (as the numeric suffixes were already preventing clobbering), but rather the multiple version saving that's prevented.

          When running Wget with -r or -p, but without -N, -nd, or -nc, re-downloading a file will result in the new copy simply overwriting the old.  Adding -nc will prevent this behavior,
          instead causing the original version to be preserved and any newer copies on the server to be ignored.

          When running Wget with -N, with or without -r or -p, the decision as to whether or not to download a newer copy of a file depends on the local and remote timestamp and size of the
          file.  -nc may not be specified at the same time as -N.

I think you want wget -r ...but please review the man page and experiment accordingly.

man pages are your friend :)

tombro 07-12-2018 09:14 AM

Sean - My bad! Thanks for reminding me of my own advice to others. RTFM
In this case, without full investigation, I copied the one liner in my haste to get this running.

scasey 07-12-2018 10:54 AM

Glad to help...
FWIW, I usually use “RTM”, ‘cause there’s (usually) no need to cuss when giving that advice...

But then, I usually use IMO instead of IMHO, ‘cause I’m seldom humble :)


All times are GMT -5. The time now is 11:26 AM.