helpstoreBackup - Support: sr #109071, StoreBackup on Mac OS 10.11 - some...

 
 

sr #109071: StoreBackup on Mac OS 10.11 - some md5sums not stored

Submitter:  None
Submitted:  Sun 19 Jun 2016 09:54:44 PM UTC
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Originator Email:  -email is unavailable- Open/Closed:  Open
Operating System:  Mac OS
* Mandatory Fields

Add a New Comment (Rich Markup)
   

Comment Type & Canned Response:
       

 

( Jump to the original submission )

Sat 16 Jul 2016 03:00:12 PM UTC, comment #11: 

Hallo Heinz-Josef,

jetzt auf Deutsch, weil das Testen zukünftiger Features wohl ausschließlich für den Autor interessant ist. Ich habe die Prüfsummen für eine Datei berechnen lassen. Soweit ich das beurteilen kann, funktioniert alles. Unten sind alle ausgeführten Befehle mit den jeweiligen Ausgaben. Wenn ich anders vorgehen soll, andere Dateinamen, mehr Dateien oä verwenden soll, bitte ich um genauere Instruktionen.

Vorweg zu meinem Mac:

$ sw_vers -productVersion
10.11.5
$ perl --version
This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

Mein Vorgehen:
-Ich habe die bisherige md5sum Datei aus /usr/local/bin umbenannt in old_md5sum
-Ich habe dein neues Skript von heute (also was zwischen "--------------------" stand) in eine Datei in /usr/local/bin/md5sum getan und die ausführbar gemacht.
-Zum Testen habe ich folgende Datei verwendet: https://secure.eicar.org/eicar.com.txt
-dann:

$ cd /usr/local/bin
$ ln md5sum sha1sum
$ ln md5sum sha224sum
$ ln md5sum sha256sum
$ ln md5sum sha384sum
$ ln md5sum sha512sum

###im folgenden Dein Skript###

$ md5sum eicar.com.txt
44d88612fea8a8f36de82e1278abb02f eicar.com.txt
$ sha1sum eicar.com.txt
3395856ce81f2b7382dee72602f798b642f14140 eicar.com.txt
$ sha224sum eicar.com.txt
b42ec8b47deb2dc75edebd01132d63f8e8d4cd08e5d26d8bd366bdc5 eicar.com.txt
$ sha256sum eicar.com.txt
275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f eicar.com.txt
$ sha384sum eicar.com.txt
038f2e50e33dacef50d7e503b45c3525fcdbe89a823f9c4417d7c13e8e96a53dd6bd6d7fcc91189c5cda7253f4455106 eicar.com.txt
$ sha512sum eicar.com.txt
cc805d5fab1fd71a4ab352a9c533e65fb2d5b885518f4e565e68847223b8e6b85cb48f3afad842726d99239c9e36505c64b0dc9a061d9e507d833277ada336ab eicar.com.txt

###zum Vergleich Vorinstalliertes benutzt###
$ md5 eicar.com.txt
MD5 (eicar.com.txt) = 44d88612fea8a8f36de82e1278abb02f
$ shasum -a 1 eicar.com.txt
3395856ce81f2b7382dee72602f798b642f14140  eicar.com.txt
$ shasum -a 224 eicar.com.txt
b42ec8b47deb2dc75edebd01132d63f8e8d4cd08e5d26d8bd366bdc5  eicar.com.txt
$ shasum -a 256 eicar.com.txt
275a021bbfb6489e54d471899f7db9d1663fc695ec2fe2a2c4538aabf651fd0f  eicar.com.txt
$ shasum -a 384 eicar.com.txt
038f2e50e33dacef50d7e503b45c3525fcdbe89a823f9c4417d7c13e8e96a53dd6bd6d7fcc91189c5cda7253f4455106  eicar.com.txt
$ shasum -a 512 eicar.com.txt
cc805d5fab1fd71a4ab352a9c533e65fb2d5b885518f4e565e68847223b8e6b85cb48f3afad842726d99239c9e36505c64b0dc9a061d9e507d833277ada336ab  eicar.com.txt

Hinweis: Die Ergebnisse Deines Skripts kann ich nicht direkt als Checksummen-Datei für das vorinstallierte shasum verwenden, weil Dein Ausgabeformat anscheinend ein anderes ist: Bei Dir ist zwischen Prüfsumme und Dateiname ein Leerzeichen, shasum erwartet aber zwei. Ich habe die Prüfsummen Deines Skripts also nur grob visuell verglichen.

Christian Duen <duen>
Sat 16 Jul 2016 01:34:36 PM UTC, comment #10: 

Hi Christian,

in the next version of storeBackup (don't know when I'm ready with it) you can chose the checksum you want (not only md5).
Can you check the following script:

--------------------
#! /usr/bin/perl

use Fcntl;
use Digest;

use strict;
use warnings;

# maskiert:
# "/tmp/ab\nc"
# \d41d8cd98f00b204e9800998ecf8427e  /tmp/ab\\nc
# "/tmp/ab\\c"
# \d41d8cd98f00b204e9800998ecf8427e  /tmp/ab\\\\c
# \n (newline), \\ (backslash)

# nicht maskiert:
# "/tmp/ab\tc"
# d41d8cd98f00b204e9800998ecf8427e  /tmp/ab c
# \a (bell), \b (backspace), \t horizontal tab, \v (vertical tab),
# \f (form feed), \r (carrage return)
# \0 results in error message in filename

my (%mapChecksum) = (
    'md5sum' => 'MD5',
    'sha1sum' => 'SHA-1',
    'sha224sum' => 'SHA-224',
    'sha256sum' => 'SHA-256',
    'sha384sum' => 'SHA-384',
    'sha512sum' => 'SHA-512'
    );

my $p =$0;      # isolate name of script
$p =~ s/\A.*\/+(.+)/$1/
    if $p =~ /\//;

unless (exists $mapChecksum{$p})
{
    print STDERR "unknown checksum <$p>\n";
    exit 1;
}

while (my $fileToRead = shift @ARGV)
{
    unless (sysopen(IN, $fileToRead, O_RDONLY))
    {
print STDERR "cannot open <$fileToRead>\n";
exit 1;
    }

    my $md5 = Digest->new($mapChecksum{$p});
    my ($buffer, $n, $size);
    while ($n = sysread(IN, $buffer, 4096))
    {
$md5->add($buffer);
    }
    close(IN);

    my $mask = '';
    my $checkSum = $md5->hexdigest();
    my $f = $fileToRead;
    if ($fileToRead =~ /[\n\\]/)
    {
$mask = "\\";
$f =~ s/\\/\\\\/g;
$f =~ s/\n/\\n/g;
    }
    print "$mask$checkSum  $f\n";
}

exit 0;
-----------------------------

store it as 'md5sum'.
Then go into the directory where you stored it and run:

chmod +x md5sum
ln md5sum sha1sum
ln md5sum sha224sum
ln md5sum sha256sum
ln md5sum sha384sum
ln md5sum sha512sum

Then please check if these commands (md5sum, sha1sum, ....) run on your MAC. (It's mostly the same script as before, but uses another library.

Regards, Heinz-Josef

Heinz-Josef Claes <hjclaes>
Project Administrator
Wed 13 Jul 2016 06:01:24 PM UTC, comment #9: 

Dear Heinz-Josef,

I'm sorry to keep you waiting. I only have the usual excuses: a colleague was on holiday, "social obligations" on match days of the Euro ...

But now I have tested your new perl-md5sum script (from your last posting). It works as expected on MAC OS 10.9 and 10.11. I have now made several backups. In the backup there were many filenames with special characters.
You have solved my problem. Thank you very much. But I still wonder how other people have used storebackup on their Macs.

Previously I mentioned that I also tried with an alias for the Apple md5 program. The output in bash looked good but when called from storeBackup it lead to the strange behavior reported in my second posting (comment #2).

I'm happy to try to test. I registered. I hope my email is visible for you now.

Christian Duen <duen>
Sun 26 Jun 2016 09:23:03 AM UTC, comment #8: 

The reason it doesn't work is quite easy to understand. I simply forgot the loop. The script can handle only one file, md5sum handles multiple ones.

The following script should do the job (tested called by storeBackup.pl):

-------------------------------------

#! /usr/bin/perl

use Fcntl;
use Digest::MD5 qw(md5_hex);

use strict;
use warnings;

while (my $fileToRead = shift @ARGV)
{
    unless (sysopen(IN, $fileToRead, O_RDONLY))
    {
print STDERR "cannot open <$fileToRead> (", _FILE_, " ", _LINE_,  ")\n";
exit 1;
    }

    my $md5 = Digest::MD5->new();
    my ($buffer, $n, $size);
    while ($n = sysread(IN, $buffer, 4096))
    {
$md5->add($buffer);
    }
    close(IN);

    my $mask = '';
    my $checkSum = $md5->hexdigest();
    my $f = $fileToRead;
    if ($fileToRead =~ /[\n\\]/)
    {
$mask = "\\";
$f =~ s/\\/\\\\/g;
$f =~ s/\n/\\n/g;
    }
    print "$mask$checkSum  $f\n";
}

exit 0;

--------------------------------

Please remember the problem with the "two underscores".

The script is not really compatible with the original md5sum program: It doesn't recognize any options. But storeBackup.pl doesn't use any options of md5sum.

If you can connect me via email, I can send you a complete version to test.

Heinz-Josef Claes <hjclaes>
Project Administrator
Wed 22 Jun 2016 11:04:04 PM UTC, comment #7: 

I am busy at the moment - I'll report back on the weekend.
Thanks again!

Anonymous
Tue 21 Jun 2016 11:13:59 AM UTC, comment #6: 

Hi,

the reason for the message
Use of uninitialized value $noCompress in numeric lt (<) at /usr/local/bin/storeBackup.pl line 2333
has no effect. You can change line 2333 to

    $noCompress = 2 if not defined $noCompress or $noCompress < 2;

to get rid of it. (This part of the code never is called when using linux, so thanks for the hint.)

Does the fault described only occurs with the md5sum perl script or with the C version also?
(The perl script doesn't behave exactly like the C version in case of "strange" filenames.)

Heinz-Josef Claes <hjclaes>
Project Administrator
Mon 20 Jun 2016 08:09:44 PM UTC, comment #5: 

Your idea worked: When I use two underlines around FILE and LINE storeBackup runs.
The speed is roughly the same.

But I noticed something confusing. Today's backups are incomplete (even if I use a minimal config without any exceptRules). The source is about 26GB, the backup only about 5GB. Many files are missing:

$ find /Users/christian/Desktop -type f | wc -l
    6379
$ du -h /Users/christian/Desktop/
 26G /Users/christian/Desktop/

vs

$ find /Users/christian/Testziel/default/2016.06.20_21.21.57 | wc -l
    1172
$ du -h /Users/christian/Testziel/default/2016.06.20_21.21.57
 5,2G /Users/christian/Testziel/default/2016.06.20_21.21.57

     

I get no error warning in the statistics output. The only thing unusual is the first line in the output of storebackup that says: "Use of uninitialized value $noCompress in numeric lt (<) at /usr/local/bin/storeBackup.pl line 2333."

So I tried to reproduce the error in a controlled environment:

I deleted all my storeBackup files.
I downloaded storeBackup-3.5.tar.bz2 and extracted its contents to ~/storeBackup
I "installed" it like this:
cd /usr/local/bin
ln -s ~/storeBackup/bin/* .

Then I ran
$ storeBackup.pl -s ~/Desktop -b ~/Testziel
Use of uninitialized value $noCompress in numeric lt (<) at /usr/local/bin/storeBackup.pl line 2333.
WARNING   2016.06.20 21:21:57 86355 created directory </Users/christian/Testziel/default>
BEGIN     2016.06.20 21:21:57 86355 backing up directory </Users/christian/Desktop> to </Users/christian/Testziel/default>
VERSION   2016.06.20 21:21:57 86355 storeBackup.pl, 3.5
INFO      2016.06.20 21:21:57 86355 setting ARG_MAX to 4096
INFO      2016.06.20 21:21:57 86355 comprRule = $size > 1024 and not $file =~ /\.zip\Z|\.bz2\Z|\.gz\Z|\.tgz\Z|\.jpg\Z|\.gif\Z|\.tiff?\Z|\.mpe?g\Z|\.mp[34]\Z|\.mpe?[34]\Z|\.ogg\Z|\.gpg\Z|\.png\Z|\.lzma\Z|\.xz\Z|\.mov\Z/i
INFO      2016.06.20 21:21:57 86355 scanning directory </Users/christian/Testziel> for existing backups
INFO      2016.06.20 21:21:57 86355 scanning directory </Users/christian/Testziel/default> for existing backups
STATISTIC 2016.06.20 21:21:57 86355 found 1 backup series, 0 backups, 0 renamed backups
INFO      2016.06.20 21:21:57 86355 consistency check finished successfully
INFO      2016.06.20 21:21:57 86355 found no references to backups from lateLinks that need storeBackupUpdateBackup run
INFO      2016.06.20 21:21:57 86355 creating lock file </tmp/storeBackup.lock>
INFO      2016.06.20 21:21:57 86355 analysis of old Backups in </Users/christian/Testziel/default>:
INFO      2016.06.20 21:21:57 86355    (0) Mon 2016.06.20_21.21.57 (0d0h): keepMinNumber1, keepWeekDays(30d)
INFO      2016.06.20 21:21:57 86355 0 entries in dbm files
INFO      2016.06.20 21:21:57 86355 0 entries in dbm block files
INFO      2016.06.20 21:41:44 86355 setting atime, mtime of directories ...
INFO      2016.06.20 21:41:44 86355 syncing ...
STATISTIC 2016.06.20 21:41:44 86355  [sec] |      user|    system
STATISTIC 2016.06.20 21:41:44 86355 -------+----------+----------
STATISTIC 2016.06.20 21:41:44 86355 process|      2.61|      3.03
STATISTIC 2016.06.20 21:41:44 86355 childs |   1163.76|     38.08
STATISTIC 2016.06.20 21:41:44 86355 -------+----------+----------
STATISTIC 2016.06.20 21:41:44 86355 sum    |   1166.37|     41.11 => 1207.48 (20m7s)
STATISTIC 2016.06.20 21:41:44 86355                    directories = 583
STATISTIC 2016.06.20 21:41:44 86355                          files = 606
STATISTIC 2016.06.20 21:41:44 86355                 symbolic links = 5
STATISTIC 2016.06.20 21:41:44 86355                     late links = 0
STATISTIC 2016.06.20 21:41:44 86355                    named pipes = 0
STATISTIC 2016.06.20 21:41:44 86355                        sockets = 0
STATISTIC 2016.06.20 21:41:44 86355                  block devices = 0
STATISTIC 2016.06.20 21:41:44 86355              character devices = 0
STATISTIC 2016.06.20 21:41:44 86355      new internal linked files = 108
STATISTIC 2016.06.20 21:41:44 86355               old linked files = 0
STATISTIC 2016.06.20 21:41:44 86355                unchanged files = 108
STATISTIC 2016.06.20 21:41:44 86355                   copied files = 110
STATISTIC 2016.06.20 21:41:44 86355               compressed files = 361
STATISTIC 2016.06.20 21:41:44 86355                  blocked files = 0
STATISTIC 2016.06.20 21:41:44 86355    excluded files because rule = 0 (0.0 )
STATISTIC 2016.06.20 21:41:44 86355    included files because rule = 0 (0.0 )
STATISTIC 2016.06.20 21:41:44 86355         max size of copy queue = 4
STATISTIC 2016.06.20 21:41:44 86355  max size of compression queue = 183
STATISTIC 2016.06.20 21:41:44 86355            calculated md5 sums = 6958
STATISTIC 2016.06.20 21:41:44 86355                    forks total = 957
STATISTIC 2016.06.20 21:41:44 86355                      forks md5 = 579
STATISTIC 2016.06.20 21:41:44 86355                     forks copy = 17
STATISTIC 2016.06.20 21:41:44 86355                    forks bzip2 = 361
STATISTIC 2016.06.20 21:41:44 86355                  sum of source = 5.3G (5644933219)
STATISTIC 2016.06.20 21:41:44 86355              sum of target all = 5.2G (5615756474)
STATISTIC 2016.06.20 21:41:44 86355              sum of target all = 99.48%
STATISTIC 2016.06.20 21:41:44 86355              sum of target new = 5.2G (5614920569)
STATISTIC 2016.06.20 21:41:44 86355              sum of target new = 99.47%
STATISTIC 2016.06.20 21:41:44 86355             sum of md5ed files =  26G (27752232514)
STATISTIC 2016.06.20 21:41:44 86355             sum of md5ed files = 491.63%
STATISTIC 2016.06.20 21:41:44 86355     sum internal linked (copy) = 483k (494526)
STATISTIC 2016.06.20 21:41:44 86355    sum internal linked (compr) = 333k (341379)
STATISTIC 2016.06.20 21:41:44 86355          sum old linked (copy) = 0.0  (0)
STATISTIC 2016.06.20 21:41:44 86355         sum old linked (compr) = 0.0  (0)
STATISTIC 2016.06.20 21:41:44 86355           sum unchanged (copy) = 483k (494526)
STATISTIC 2016.06.20 21:41:44 86355          sum unchanged (compr) = 333k (341379)
STATISTIC 2016.06.20 21:41:44 86355                 sum new (copy) = 150M (157468216)
STATISTIC 2016.06.20 21:41:44 86355                sum new (compr) = 5.1G (5457452353)
STATISTIC 2016.06.20 21:41:44 86355     sum new (compr), orig size = 5.1G (5486422951)
STATISTIC 2016.06.20 21:41:44 86355                 sum new / orig = 99.49%
STATISTIC 2016.06.20 21:41:44 86355       size of md5CheckSum file =  31k (31400)
STATISTIC 2016.06.20 21:41:44 86355     size of temporary db files = 0.0  (0)
STATISTIC 2016.06.20 21:41:44 86355            deleted old backups = 0
STATISTIC 2016.06.20 21:41:44 86355            deleted directories = 0
STATISTIC 2016.06.20 21:41:44 86355                  deleted files = 0
STATISTIC 2016.06.20 21:41:44 86355           (only) removed links = 0
STATISTIC 2016.06.20 21:41:44 86355 freed space in old directories = 0.0  (0)
STATISTIC 2016.06.20 21:41:44 86355       add. used space in files = 5.2G (5614951969)
STATISTIC 2016.06.20 21:41:44 86355                backup duration = 19m47s
STATISTIC 2016.06.20 21:41:44 86355 over all files/sec (real time) = 0.51
STATISTIC 2016.06.20 21:41:44 86355  over all files/sec (CPU time) = 0.50
STATISTIC 2016.06.20 21:41:44 86355                      CPU usage = 101.73%
INFO      2016.06.20 21:41:44 86355 removing lock file </tmp/storeBackup.lock>
WARNING   2016.06.20 21:41:44 86355 -- 1 WARNING OCCURRED DURING THE BACKUP! --
END       2016.06.20 21:41:44 86355 backing up directory </Users/christian/Desktop> to </Users/christian/Testziel/default/2016.06.20_21.21.57>

I extracted the .md5CheckSums.bz2 in the backup. It only contains
line 1: your headline
line 2-1168: entries for folders and directories
line 1169: blank line

On subsequent runs things don't improve. Running "storeBackup.pl -s /users/christian/Desktop -b /users/christian/Testziel" didn't change anything.
When I want to generate a template I got the same error:
$ storeBackup.pl -g sB_generiert
Use of uninitialized value $noCompress in numeric lt (<) at /usr/local/bin/storeBackup.pl line 2333.

Among the missing files I can't find any regularity. I think I'm not allowed to share a list of all my filenames. If you don't have access to a Mac yourself maybe I should stop trying to run sB on my Mac?

Anonymous
Mon 20 Jun 2016 05:25:28 PM UTC, comment #4: 

It seems to be impossible to write this line correctly in this web site.

Call this command and you get the write item (I hope):
echo 'xxFILExx' | sed -e 's/x/_/g'

Heinz-Josef Claes <hjclaes>
Project Administrator
Mon 20 Jun 2016 05:21:03 PM UTC, comment #3: 

That's really funny, the problem with the perl scripts seems to be a copy/paste/conversion bug :-) .

The item must  _FILE _ with two underscores at the beginning and at the end (naturally without the blank I wrote here).
Same for _LINE _

Or simply change the affected line to:
    print STDERR "cannot open <$fileToRead>\n";

Does this work for you?

Heinz-Josef Claes <hjclaes>
Project Administrator
Mon 20 Jun 2016 03:09:40 PM UTC, comment #2: 

Dear Heinz-Josef,
Thank you very much for your quick response (and your software in general). Your link pointed me to the solution, your perl script doesn't run.

Details:
my self-compiled md5sum is broken. I probably should have looked for a log-file... I tested it on a widely used file with a known hash:
 $ md5sum eicar.com.txt
 96bfdd90a83ca64c1589d7c51e570107  eicar.com.txt
For a comparison I used the apple md5 command
 $ md5 eicar.com.txt
 MD5 (eicar.com.txt) = 44d88612fea8a8f36de82e1278abb02f

Your perl script: I really like the idea of a self-contained solution which protects you from changes in the binaries provided by the OS. I put it in a text editor and saved it as md5sum. Then I copied with "sudo mv /path/to/md5sum /usr/local/bin/md5sum" Then I ran "sudo chattr +x "/usr/local/bin/md5sum".
 $ md5sum eicar.com.txt
 Bareword "_FILE_" not allowed while "strict subs" in use at /usr/local/bin/md5sum line 9.
 Bareword "_LINE_" not allowed while "strict subs" in use at /usr/local/bin/md5sum line 9.
 Execution of /usr/local/bin/md5sum aborted due to compilation errors.

Line 9 of your script is "print STDERR "cannot open <$fileToRead> (", FILE, " ", LINE, ")\n";"

My perl version:
 $ perl --version
 This is perl 5, version 18, subversion 2 (v5.18.2) built for darwin-thread-multi-2level
(with 2 registered patches, see perl -V for more detail)

Then I tried the link you provided. I found it years ago when I first used storeBackup. I didn't succeed so I got into compiling md5sum. But probably I didn't know enough about the unix cli back then. Last night I was so frustrated that it didn't occur to me to revisit this approach.

At first I tried the suggested method of putting "alias md5sum='md5 -r'" in my .profile. I think in the past I also tried .bashrc. Then I restarted terminal (to reload my .profile)
From the terminal I succeed:
 $ alias md5sum='md5 -r'
 $ md5sum eicar.com.txt
 44d88612fea8a8f36de82e1278abb02f eicar.com.txt

But storeBackup fails:
 BEGIN     2016.06.20 14:03:01  5134 backing up directory </Users/...> to <....>
 VERSION   2016.06.20 14:03:01  5134 storeBackup.pl, 3.5
 INFO      2016.06.20 14:03:01  5134 setting ARG_MAX to 4096
 ERROR     2016.06.20 14:03:01  5134 the following programs are not in $PATH:
 ERROR     2016.06.20 14:03:01  5134 md5sum
 ERROR     2016.06.20 14:03:01  5134 please install or check $PATH
 ERROR     2016.06.20 14:03:01  5134 $PATH is  /Users/christian/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
 ERROR     2016.06.20 14:03:01  5134 caught signal 1, terminating

Then I tried something slightly different. After resetting my .profile I made a file md5sum in /usr/local/bin containing this:
#!/bin/sh
/sbin/md5 -r "$1"
From the terminal I succeed:
 $ md5sum eicar.com.txt
 44d88612fea8a8f36de82e1278abb02f eicar.com.txt

Then I tried storeBackup and now it starts and runs without warnings. So you seem to have solved my problem. Thanks again!
If contrary to expectations I run into problems I will report back.
If you have an idea for my problems with your perl script I would happily test it on my mac 10.11 (and another mac running 10.9).

PS MacOS creates a hidden .DS_Store file in every folder. I don't want to save it. For this I use "--exceptRule '\$file =~ m#\.DS_Store\$#'" which seems to work as intended. Did I make a mistake? I tried to adapt your "example 4" from the bottom of http://www.nongnu.org/storebackup/de/node51.html .

Anonymous
Mon 20 Jun 2016 05:38:02 AM UTC, comment #1: 

I also think it's a problem with md5sum.

try the following:

$ cd /tmp
$ touch xxxx
$ md5sum xxxx
d41d8cd98f00b204e9800998ecf8427e  xxxx
$
if this doesn't work in the same way as described (even the output format of md5sum) storeBackup will not work.

I searched in the internet and found:
https://raamdev.com/2008/howto-install-md5sum-sha1sum-on-mac-os-x/
Maybe this helps!?

I just wrote a simple md5sum simulator in perl:

#! /usr/bin/perl

use Fcntl;
use Digest::MD5 qw(md5_hex);

use strict;
use warnings;

my ($fileToRead) = @ARGV;

unless (sysopen(IN, $fileToRead, O_RDONLY))
{
    print STDERR "cannot open <$fileToRead> (", _FILE_, " ", _LINE_,  ")\n";
    exit 1;
}

my $md5 = Digest::MD5->new();
my ($buffer, $n, $size);
while ($n = sysread(IN, $buffer, 4096))
{
    $md5->add($buffer);
}
close(IN);

print $md5->hexdigest(), "  $fileToRead\n";

exit 0;

save it as "md5sum" and place it in your path (before other versions of md5sum which may exist.
Does it work for you (with the test of 'xxxx' above?

If yes, I'll write a version which also works with "\n" in the filename.

Heinz-Josef Claes <hjclaes>
Project Administrator
Sun 19 Jun 2016 09:54:44 PM UTC, original submission:  

I know SB is not targeted at Apple. I don't expect an answer - I'm only posting because I hope I'm lucky or I made some obvious mistake.

When I run a backup in Mac OS 10.11 with the latest StoreBackup-Version I get this for many files:
WARNING  ... file </path/filename> changed during backup
I looked at an .md5CheckSums file: Files that got the warning don't have an md5 checksum at the beginning of "their" line. Instead for every file it sais: "gggggggggggggggggggggggggggggggg".

In the past I have succesfully used StoreBackup with my old Mac. But this ran on 10.9. In 10.11 I used the md5sum binary that I had compiled under 10.9. I copied it to /usr/local/bin (sudo mv ... ). When I got these strange warnings I installed xcode an recompiled from the md5sum folder from storeBackup: I made a new project for the os-x-commandline and dropped the three files from the source folder. Then I clicked on Product>Build. I put the output in /usr/local/bin. Buth this new version didn't help.
I might have made a mistake because I don't know too much about compiling software.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by duen (Posted a comment)
  • -email is unavailable- added by hjclaes (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.9