Create incremental snapshots of individual folders using find and tar-gzip

find /mnt/storage/profiles/ -maxdepth 1 -mindepth 1 -type d | while read d; do tarfile=`echo "$d" | cut -d "/" -f5`; destdir="/local/backupdir/"; tar -g "$destdir"/"$tarfile".snar -czf "$destdir"/"$tarfile"_`date +%F`.tgz -P $d; done
Creates an incremental snapshot of individual folders.

3
2013-12-05 19:20:31

What Others Think

Nice info ">Mobile App Development Dublin
IPHSTechnologies · 19 weeks and 1 day ago
I have tried the code you have provided and was able to successfully create incremental snapshots of individual folders using find and tar.gzip. thanks for the information and looking forward to more such helpful force which is really helpful for the programmers like me. arcade machine rental
Juvanta · 16 weeks ago
I am so happy to see this post here. In this post, the author shares some details about successfully create incremental snapshots of individual folders using find and tar.gzip. You gave a detailed description and easy to understand. Thanks for sharing the post. DC Law group personal injury
ryanbabraham · 11 weeks and 4 days ago
Change Timestamp is a freeware tool that you may find helpful for editing the time related properties of files. The program is portable, and the extracted folder is about 325KB in size. It has two files in it, an executable and a text document. Run the Ctime.exe to start the program. Change Timestamp's interface has a small window with various options. Dallas Capital Bank login
hrihant · 4 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: