Create Single Archive File (TAR) from Multiple Files on Subdirectory

There’s a simple command on *NIX based system which is handy for admin to create a single archive file (tar) from multiple files on a subdirectory. Thanks to the joy of *NIX piping. The sample command is:

# find directory -name "*.log" -type f -mtime +2   
   | xargs tar -cvf a.tar -

Credit to: dennis.jacob
http://www.unix.com/solaris/80371-find-files-older-than-x-days-create-consolidated-single-tar-file.html

Create Single Archive File (TAR) from Multiple Files on Subdirectory

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s