Sponsored Content
Full Discussion: Create an incremental tar
Top Forums UNIX for Dummies Questions & Answers Create an incremental tar Post 302920493 by jim mcnamara on Thursday 9th of October 2014 03:46:05 PM
Old 10-09-2014
Put complete names in the file like a relative path from a starting directory.
Code:
./path/to/fname

Or a full path
Code:
/directory/path/to/fname

This is efficient in that it invokes tar once. And simply writes to the current end of the tar file. The tarfile must exist for this work.

Code:
my_tar=/tmp/mytar.tar
touch $my_tar                      # create the file if needed
cd /starting/directory
tar -rvf $my_tar `cat /path/to/list_of_files.txt`

tar usually has a -u option (update). Try to avoid it, because it is sloooow. -r is a simpler way to keep the most recent copy of a file.

Let's say you want files just modified in the last 24 hours, here all put together.
Code:
cd /starting/directory
find . -mtime -1 > /path/to/list_of_files.txt
my_tar=/tmp/mytar.tar
touch $my_tar                      # create the file if needed
tar -rvf $my_tar `cat /path/to/list_of_files.txt`

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

tar - incremental backup

Hello everyone! I'm trying to make incremental tar archives of a folder for an example. On the box I use is UNIX AIX installed. I tried some sample codes I found on several web pages but with no success. Don't know what I'm doing wrong. Please write some sample code to make incremental tar... (0 Replies)
Discussion started by: Funky_ass
0 Replies

2. SCO

Incremental Backup using TAR in sco Openserver 5.0

Incremental Backup using TAR in sco Openserver 5.0 Dear all I am using sco openserver 5.0. I wanted to take backup of two folder (each 600 MB size) with lot of files. I used to take backup using tar command daily using a script. But the same takes more time. Is there any way to take backup... (0 Replies)
Discussion started by: jamcalicut
0 Replies

3. HP-UX

tar says: cannot create

Hello, I'm quite new to HP-UX and I stumbeled upon some strange behaviour from tar. I have a script like this: find -mtime $days -type f|xargs tar cvf tarfile.tar and it make me a tar file with files that has been changed in $days. When i run 'tar tf tarfile.tar' it give me output like... (5 Replies)
Discussion started by: oey2000
5 Replies

4. UNIX for Advanced & Expert Users

How to create a Tar of multiple Files in Unix and FTP the tar to Windows.

Hi, On my Unix Server in my directory, I have 70 files distributed in the following directories (which have several other files too). These files include C Source Files, Shell Script Source Files, Binary Files, Object Files. a) /usr/users/oracle/bin b) /usr/users/oracle... (1 Reply)
Discussion started by: marconi
1 Replies

5. UNIX for Advanced & Expert Users

Do incremental backup without tar files up

I'm trying to do a incremental backup for a big NFS. Since space is not an issue, I don't want to compress them or end up with a big tarball for full backup( and a series of small tarballs for incremental backup). Basically I want the TAR backup/restore functionality but not TAR files up.... (3 Replies)
Discussion started by: overmindxp
3 Replies

6. UNIX for Dummies Questions & Answers

How to create rpm from tar.gz?

I m planning to use puppet to implement organizational linux hardening policies across the linux servers. To begin with i have downloaded. puppet-2.7.1.tar.gz and tried some basic configuration to get start with puppet. Now i want to roll out the puppet but before that i would like to make... (7 Replies)
Discussion started by: pinga123
7 Replies

7. Shell Programming and Scripting

Create tar file

Following are the list of files available in the dataout directory a1.txt.gz a2.txt.gz b3.txt.gzStep 1: now the tar file needs to be created as follows. tar -cvf ab.tar *.gzAll the files with extn .gzg has to be bundled in the tar file. Once the tar file is created, the files which are... (9 Replies)
Discussion started by: kmanivan82
9 Replies

8. UNIX for Dummies Questions & Answers

Create Tar files

Hi, the folder /home/nandy/test will have two files called notepad1 nodepad2 when i issued /home/nandy/test> tar -cvf componse.tar ./notepad1 ./notepad2 and no error /home/nandy/test> tar -cvf nan.tar . --> this creates nan.tar with the below message nan.tar same... (1 Reply)
Discussion started by: Nandy
1 Replies

9. Shell Programming and Scripting

Incremental Backup using tar for more than one path

Hi everyone; I need to create a shell script for full and incremental backup purposes. for incremental backup only for one folder (test1) located in /home/test1 syntax below works fine and have no problem: tar -cvf /home/backup/backup-0.tar.gz -g /home/test1/test.snar /home/test Problem is here... (5 Replies)
Discussion started by: momed131
5 Replies

10. Shell Programming and Scripting

Create Tar ball

Hi Team, Following unix command is throwing error. Can anyone please help me to fix the issue? tar -cvf /aa/bb/cc/tarball1.tar /x/y/z1/abc.ksh /x/y/z2/pqr.txt /x/y/z3/lmn.tmp Error message thrown: tar: Removing leading `/' from member names OS: uname -a Linux xyz... (1 Reply)
Discussion started by: kmanivan82
1 Replies
GIT-TAR-TREE(1) 						    Git Manual							   GIT-TAR-TREE(1)

NAME
git-tar-tree - Create a tar archive of the files in the named tree object SYNOPSIS
git tar-tree [--remote=<repo>] <tree-ish> [ <base> ] DESCRIPTION
THIS COMMAND IS DEPRECATED. Use git archive with --format=tar option instead (and move the <base> argument to --prefix=base/). Creates a tar archive containing the tree structure for the named tree. When <base> is specified it is added as a leading path to the files in the generated tar archive. git tar-tree behaves differently when given a tree ID versus when given a commit ID or tag ID. In the first case the current time is used as modification time of each file in the archive. In the latter case the commit time as recorded in the referenced commit object is used instead. Additionally the commit ID is stored in a global extended pax header. It can be extracted using git get-tar-commit-id. OPTIONS
<tree-ish> The tree or commit to produce tar archive for. If it is the object name of a commit object. <base> Leading path to the files in the resulting tar archive. --remote=<repo> Instead of making a tar archive from local repository, retrieve a tar archive from a remote repository. CONFIGURATION
tar.umask This variable can be used to restrict the permission bits of tar archive entries. The default is 0002, which turns off the world write bit. The special value "user" indicates that the archiving user's umask will be used instead. See umask(2) for details. EXAMPLES
git tar-tree HEAD junk | (cd /var/tmp/ && tar xf -) Create a tar archive that contains the contents of the latest commit on the current branch, and extracts it in /var/tmp/junk directory. git tar-tree v1.4.0 git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release. git tar-tree v1.4.0^{tree} git-1.4.0 | gzip >git-1.4.0.tar.gz Create a tarball for v1.4.0 release, but without a global extended pax header. git tar-tree --remote=example.com:git.git v1.4.0 >git-1.4.0.tar Get a tarball v1.4.0 from example.com. git tar-tree HEAD:Documentation/ git-docs > git-1.4.0-docs.tar Put everything in the current head's Documentation/ directory into git-1.4.0-docs.tar, with the prefix git-docs/. AUTHOR
Written by Rene Scharfe. DOCUMENTATION
Documentation by David Greaves, Junio C Hamano and the git-list <git@vger.kernel.org[1]>. GIT
Part of the git(1) suite NOTES
1. git@vger.kernel.org mailto:git@vger.kernel.org Git 1.7.1 07/05/2010 GIT-TAR-TREE(1)
All times are GMT -4. The time now is 08:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy