Re: Automated-backup script

From: Daniel Lidstrom (someone_at_microsoft.com)
Date: 05/11/04


Date: Tue, 11 May 2004 21:18:02 +0200

On Tue, 11 May 2004 16:23:58 +0000, Matt_left_coast wrote:

> Daniel Lidstrom wrote:
>
>> Hi,
>>
>> I'm doing some backups for a friend. The script is placed in
>> /etc/cron.daily and looks like this:
>> #!/bin/bash
>> wget http://www.sweden.se/ptk-src.tar.gz -P /backup/bobbo > /dev/null 2>&1
>>
>> This produces lots of ptk-src.tar.gz's in /backup/bobbo. I'd like to save
>> only those that differ from previous versions. So, instead of having
>> ptk-src.tar.gz.1, ptk-src.tar.gz.2, etc, that are all the same file, how
>> can I save only the one that differs from previous? I don't mind the
>> numbering, infact I think it is good.
>>
>> Thanks a lot!
>>
>
> You could write a script that does a checksum then save only the ones where
> the checksums differ.

If I knew how to write that script, it would already be done :-)
My idea is the following:
1) download the backup file
2) find out what name it was given (by finding the latest modified file)
3) By name of file, I know what is the next-latest file (last
character of file, if it is a digit, minus 1)
4) Compute checksums for both files.
5) If equal, remove latest file
6) Else, do nothing

Anybody who is fluid with scripts that can help me?
Thanks in advace.

-- 
Daniel
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?


Relevant Pages

  • Re: Run .bat as Scheduled Task doesnt work, but manual execute wo
    ... which could differ if it's run by the task scheduler. ... > The script does some various things with windows script host and does ... > I can't figure out what the difference is between executing the bat file ...
    (microsoft.public.vb.general.discussion)
  • Re: Forth and Co - The Return of the Jedi
    ... I'm curious what attributes you think a "Forth script" would have and how it would differ from Forth. ... AI's need definitions but humans can comprehend metaphor. ... And since he used "Forth" distinct from "Forth script" that suggests to me that he can at the very least discuss the differences between those two words. ... people are free to call pretty much anything a scripting language. ...
    (comp.lang.forth)
  • Automated-backup script
    ... I'm doing some backups for a friend. ... The script is placed in ... only those that differ from previous versions. ...
    (alt.linux)
  • Re: Automated-backup script
    ... > I'm doing some backups for a friend. ... > only those that differ from previous versions. ... You could write a script that does a checksum then save only the ones where ... the checksums differ. ...
    (alt.linux)
  • Re: Foiling MITM attacks on source and ports trees
    ... Given read-only access to the repository, ... A script that has access to the Subversion repo would ... first in batch mode compute md5/sha256 checksums for *all* revisions ... and store them in the database as well. ...
    (freebsd-questions)