Re: Automated-backup script
From: Daniel Lidstrom (someone_at_microsoft.com)
Date: 05/11/04
- Next message: Matt_left_coast: "Re: Automated-backup script"
- Previous message: J.O. Aho: "Re: ext3 filesystem runs as ext2"
- In reply to: Matt_left_coast: "Re: Automated-backup script"
- Next in thread: Matt_left_coast: "Re: Automated-backup script"
- Reply: Matt_left_coast: "Re: Automated-backup script"
- Reply: Will Wesley: "Re: Automated-backup script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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?
- Next message: Matt_left_coast: "Re: Automated-backup script"
- Previous message: J.O. Aho: "Re: ext3 filesystem runs as ext2"
- In reply to: Matt_left_coast: "Re: Automated-backup script"
- Next in thread: Matt_left_coast: "Re: Automated-backup script"
- Reply: Matt_left_coast: "Re: Automated-backup script"
- Reply: Will Wesley: "Re: Automated-backup script"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|