"different md5sums depending on whether or not the source is
piped" should be a big red flag.  Somebody somewhere is corrupting
your file.  The only exception I can think of is if you're transferring over
HTTP, files are sometime (de)compressed automatically,.

You should definitely verify that the file you write can be read back
and untarred.

On Thu, Mar 31, 2011 at 8:41 PM, Jackman <[email protected]> wrote:
> Here's another crazy question:
>
> I'm writing a script that deals with the creation of backup files.  It
> seems like it would be wise to come up with a file name ahead of time
> in the off chance that my generation criteria (the date and time)
> changes while the script is running.
>
> In short, the script is as follows:
>
> Come up with file name.
> Create the archive from $SRC.
> If older files exist, compare the new file and the most recent files
> using md5sum.
> If the files don't differ, delete the new file.
>
> This is the line that generates to the filename:
>
> NEW_FILE="$($DEST/www_$(date +\%Y\%m\%d-\%H\%M).tar.bz2)"
>
> I thought this just generated and assigned a string.  Why do I get the
> following response?
>
> -bash: /var/chroot/home/content/07/7224307/backups/www_20110331-2029.tar.bz2:
> No such file or directory
>
> Why doesn't bash does take it as a string of characters?
>
> BTW, I think it's worth including the reason why I'm going to the method 
> above.
>
> The old script is as follows:
>
> Pipe $SRC into tar/bz2 into md5sum.
> Pipe the old file (if it exists) into md5sum.
> Compare the outputs.
> If the outputs differ, use tar to create a new archive from $SRC.
>
> This works great on my home PC, but the remote server (at GoDaddy)
> generates different md5sums depending on whether or not the source is
> piped.
>
>
> --
> Andrew Jackman
> [email protected]
>
> CONFIDENTIALITY NOTICE: This e-mail message, including any
> attachments, is for the sole use of the intended recipient(s) and may
> contain confidential and privileged information. Any unauthorized
> review, use, disclosure, or distribution is prohibited. If you are not
> the intended recipient, please contact the sender by reply e-mail and
> destroy all copies of the original message.
> _______________________________________________
> EUGLUG mailing list
> [email protected]
> http://www.euglug.org/mailman/listinfo/euglug
>



-- 
Bob Miller                              K<bob>
                                        [email protected]
_______________________________________________
EUGLUG mailing list
[email protected]
http://www.euglug.org/mailman/listinfo/euglug

Reply via email to