help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using make for backups


From: Payal
Subject: Re: using make for backups
Date: Wed, 26 Aug 2009 21:25:19 -0700
User-agent: Mutt/1.5.18 (2008-05-17)

Sorry for the late reply. I was on leave for 2 days.
Thanks a lot Harvey for the makefile. The shell function is great.
Thanks a lot hofrat for  telling great options on tar.

Regards,
Payal

On Mon, Aug 24, 2009 at 10:06:40AM -0400, Harvey Chapman wrote:
> Perhaps something like this might work. It just uses find to find the  
> first item in the tree newer than the archive. It uses the output to  
> force a rebuild. The downside is that the find may take a while. If  
> anyone has more feedback, I'd appreciate it as I need something like  
> this as well.
>
> #-*-Makefile-*-
>
> DIR_NAME=files
> TGZ_NAME=$(DIR_NAME).tgz
>
> .PHONY: clean all
> all: $(TGZ_NAME)
>       @echo "Build complete."
>
>
> NEW_FILES=$(shell find $(DIR_NAME) -newer $(TGZ_NAME) -print -quit 2> / 
> dev/null)
>
> $(TGZ_NAME): $(NEW_FILES)
>       @echo "tar -cvzf $@ $(DIR_NAME)"
>       @tar -cvzf $@ $(DIR_NAME)
>
> clean:
>       @rm -f $(TGZ_NAME)
>
> On Aug 24, 2009, at 7:15 AM, Payal wrote:
>
>> Hi all
>> Daily I take backup of a folder like this.
>> tar -czf d-`date +%d%m%y`.tar.gz designs/
>> The size comes ~ 2Gb of tar ball.
>> There are tens of folders/sub-folders inside design/.
>> I observed that many days none of the files in design folder are  




reply via email to

[Prev in Thread] Current Thread [Next in Thread]