On Feb 16, 2008 9:53 PM, John Mort <[EMAIL PROTECTED]> wrote:

> I'm trying to write a script that will dump one of my databases, then
> check to see if anything has changed since the last time the script
> ran (the idea being to remove duplicate backups to save disk space).
> Using cmp isn't an option because apparently some small number of bits
> are always changing so each dump is "unique".   So I'm trying to just
> compare the file sizes, but I'm apparently doing something wrong.  Any
> help would be appreciated.
>
> The code:
>
>

I think all you need to do is add in the brackets to your if statement (with
spaces before/after them)


> if [ $(stat -c%s $olddump) -eq $(stat -c%s $newdump) ]





>
> then
> echo No changes.
> else
> echo File has changed.
> fi
>
>
> The error:
> $ sh foo.shell
> foo.shell: 25: 875479: not found
> Backing up changes.
>
>
> Right now the files are equal size, so it should say "No changes."
> 875479 is the size of the files. I've tried dumping the stat command
> results into variables and comparing the variables, but I still get
> this same error message.  My googlemancy isn't powerful enough to come
> up with the answer on my own. :-/
>
> --
> John D. Mort
> http://john.mort.net
> _______________________________________________
> Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
> http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
> Upcoming Meetings (6pm - 8pm)                         MHVLS Auditorium
>  Feb 6 - DBUS
>  Mar 5 - Setting up a platform-independent home/small office network using
> Linux
>
_______________________________________________
Mid-Hudson Valley Linux Users Group                  http://mhvlug.org          
   
http://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug                           
Upcoming Meetings (6pm - 8pm)                         MHVLS Auditorium          
        
  Feb 6 - DBUS
  Mar 5 - Setting up a platform-independent home/small office network using 
Linux

Reply via email to