we are on COW fs (zfs) so always save to new file
authorDobrica Pavlinusic <dpavlin@rsync1.maxxo.com>
Wed, 11 Apr 2012 18:25:31 +0000 (20:25 +0200)
committerDobrica Pavlinusic <dpavlin@rsync1.maxxo.com>
Wed, 11 Apr 2012 18:25:34 +0000 (20:25 +0200)
This also has nice side-effect that we won't destroy last copy
if for some reason we can't generate new one

gearman/list_files

index 4be8768..306b7e7 100755 (executable)
@@ -6,6 +6,6 @@ while read path ; do
        if [ -e $path/.meta/files ] ; then
                cat $path/.meta/files
        else
-               find -L $path -printf "%y %s %p\n" | tee $path/.meta/files
+               find -L $path -printf "%y %s %p\n" | tee $path/.meta/files.new && mv $path/.meta/files.new $path/.meta/files
        fi
 done