Sponsored Content
Full Discussion: Zipping
Top Forums UNIX for Beginners Questions & Answers Zipping Post 303014087 by apmcd47 on Monday 5th of March 2018 04:50:04 AM
Old 03-05-2018
Quote:
Originally Posted by Stellaman1977
Good Morning,

I'd like to archive an old user's files in the home directory on Solaris 9

Will this work?

Code:
cd home
tar -zcvf jsmitharchive.tar.gz jsmith/

Solaris tar does not support the GNU option z to send it through gzip. Instead use
Code:
cd home
tar cvf - jsmith | gzip -c > jsmitharchive.tar.gz

Remember also that tar extracts files to the path they were archived from, so if you use
Code:
tar cvf archive.tar /home/jsmith

and then extract the archive it will overwrite a new /home/jsmith (GNU versions of tar strip the leading '/' to stop this from happening).

Quote:
Also- is the last
Code:
/

necessary (after jsmith)
No.

Andrew
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

zipping in a loop

Hello All, I have a requirement that i need to gzip each file that is more than 5 days old inside a directory. Could some one help me with the script ? do i need to write a for loop or can be done through single command? Thanks, Sateesh (2 Replies)
Discussion started by: kotasateesh
2 Replies

2. UNIX for Dummies Questions & Answers

Zipping

Hi In unix i want to zip the files in a directory excluding *.dmp, *.log, *.lst, *.out files in that directory. pls let me know what command to use. $zip ........ ? Thanks (1 Reply)
Discussion started by: dreams5617
1 Replies

3. UNIX for Advanced & Expert Users

Help me While zipping the file

Hi , I have written code which will ask the subject,body of the mail, attachment and mail id of the receipient. Code will pick up 4 files zip it. It will zip all the files and then post the mail to the receipient. While zipping the file i am getting error. Can anyone help me with this. ... (7 Replies)
Discussion started by: Jolly
7 Replies

4. Shell Programming and Scripting

zipping files

Dear Experts, I need a script which will zipped the files older than 2 days. but i dont want to use find . * -mtime 2. Is there is any other method to achive this task. i will ececute the script daily. Regards, (3 Replies)
Discussion started by: shary
3 Replies

5. UNIX for Dummies Questions & Answers

Zipping files?

how would i zip a file? what does zip mean? (4 Replies)
Discussion started by: trob
4 Replies

6. Shell Programming and Scripting

zipping files

Hi, Is there any difference if files are individually zipped and archived in a directory or if files are moved into archiving directory and zipping that directory. (3 Replies)
Discussion started by: swathich
3 Replies

7. UNIX for Dummies Questions & Answers

Help With zipping a file

Hi I need to zip a file and move it into another folder along with the timestamp. The orginal file must be removed from the source directory Source : folder1/source12.txt folder2 After zipping Folder1/Folder2/source12.zip Any help will be greatly appreciarted ... (5 Replies)
Discussion started by: akshay01987
5 Replies

8. UNIX for Dummies Questions & Answers

Zipping files

Hi All, I have a scenario where in am using uuencode to send a txt file as an excel to end users( email attachment).I have 7 different files and these files are sent as emails 7 times... So my question is, can i not zip all the 7 files at once and attach those files in a single... (9 Replies)
Discussion started by: saggiboy10
9 Replies

9. Shell Programming and Scripting

Zipping files

Hi Guys, The script below works but it creates a zip folder under 123_arch.zip -- test1 -- orig1.txt -- orig2.txt -- orig3.txt -- orig4.txt I don't want the sub directory test1 but everything under the base *arch name I can not create a long name with... (4 Replies)
Discussion started by: GaryP1973
4 Replies

10. Shell Programming and Scripting

Help with grouping and zipping

Hi can you please help with the below ? source file: Column1,Column2,Column3,Column4 abc,123,dir1/FXX/F19,1 abc,123,dir1/FXX/F20,1 abc,123,dir1/FXX/F23,2 abc,123,dir1/FXX/C25,2 abc,123,dir1/FXX/X25,2 abc,123,dir1/FXX/A23,3 abc,123,dir1/FXX/Z25,3 abc,123,dir1/FXX/Y25,4 I want to... (3 Replies)
Discussion started by: paul1234
3 Replies
BF_TAR(1)																 BF_TAR(1)

NAME
bf_tar - shell script to write a tar file of a bogofilter directory to stdout SYNOPSIS
bf_tar [-r] [-R] bogofilter_directory DESCRIPTION
bf_tar bundles a bogofilter working directory in tar format and copies it to standard output (your console, or where you redirect it, see EXAMPLES below). OPTIONS
The -r option causes bf_tar to remove inactive log files after the archive has been written successfully. The default is to leave log files. The -R option causes bf_tar to remove inactive log files before the archive is written. This may reduce chances that the resulting archive is recoverable should it become damaged. The archive may be smaller though. The default is to leave log files. EXIT STATUS
The script exits with status code 0 if everything went well, and nonzero if it encountered trouble. EXAMPLES
o bf_tar ~/.bogofilter > outfile.tar Writes a standard .tar file containing the essential files from ~/.bogofilter to outfile.tar. o bf_tar ~/.bogofilter | gzip -9 -c > outfile.tar.gz Writes a gzipped .tar.gz file containing the essential files from ~/.bogofilter to outfile.tar.gz. o bf_tar `pwd`/mydirectory > outfile.tar Prepend $(pwd)/ or `pwd`/ if you want to specify an absolute path instead of a relative path. NOTES
This script is meant for use with Berkeley DB based bogofilter versions. This script requires a SUSv2 compliant pax utility. This script expects a SUSv2 compliant shell. Solaris systems should have the SUNWxcu4 package installed (when bogofilter is configured) so that /usr/xpg4/bin/sh can be used. 07/23/2007 BF_TAR(1)
All times are GMT -4. The time now is 08:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy