Sponsored Content
Top Forums UNIX for Dummies Questions & Answers compress/decompress don't take you back to the same file Post 302283151 by chebarbudo on Monday 2nd of February 2009 05:09:25 PM
Old 02-02-2009
Question compress/decompress don't take you back to the same file

Hi there,
I have a file system.tgz. I want to make changes inside this archive but before that, I want to be sure I recompress it in the exact same format.
So I did the following:
Code:
me:~# # Duplicate the archive ---------------------------------
me:~# cp system.tgz system.01.tgz
me:~# ls -l system.tgz system.01.tgz
-rw-r--r-- 1 root root 274650447 2009-02-02 22:41 system.01.tgz
-rw-r--r-- 1 root root 274650447 2009-02-02 21:32 system.tgz
me:~#
me:~# # Unzip the archive -------------------------------------
me:~# mkdir system.01/
me:~# tar -zxf system.01.tgz -C system.01/
me:~#
me:~# # Rezip the archive -------------------------------------
me:~# cd system.01/
me:~/system.01# tar -zcf system.01.tgz *
me:~/system.01# mv system.01.tgz ../
me:~/system.01# cd ..
me:~#
me:~# # Compare with previous archive -------------------------
me:~# ls -l system.tgz system.01.tgz
-rw-r--r-- 1 root root 274642873 2009-02-02 22:54 system.01.tgz
-rw-r--r-- 1 root root 274650447 2009-02-02 21:32 system.tgz

As you can see, the archive is not exactly as it was. Maybe I'm not using the same compression level? But I have no idea how to set this parameter.
Thanks for your help.
Santiago
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

[help] Cant compress file

Anybody know what happened here? 162 lab2-36:~/try_direct/another> compress url.txt url.txt: -- file unchanged (8 Replies)
Discussion started by: endeavour1985
8 Replies

2. UNIX for Advanced & Expert Users

compress more than one file

hi, I need to compress a couple files in a directory.i tried using tar cvf filename1 filename2 but i am not able to open tar file. please suggest how to compress more than one file in to same file thanks in advance (2 Replies)
Discussion started by: prasee
2 Replies

3. UNIX for Dummies Questions & Answers

Decompress a .SP file

Hi to all, I'm new in this forum and I just need a quick answer from the experts out there, I have a 2761.sp file, in short a ".SP" file, it was given to me compressed, and I need to decompress it before Monday. I saw a software named Splint, but it shows an error, a DMI error message, so I dont... (3 Replies)
Discussion started by: jeco
3 Replies

4. Shell Programming and Scripting

unix script to takes the old data from a TXT file and compress them into new file

Hi, I am looking for the unix script which can takes the 2 month old data from a TXT file (there is one txt file in whiche messages are appended on daily basis) and compress them into new file.Please halp me out. (2 Replies)
Discussion started by: vpandey
2 Replies

5. UNIX for Dummies Questions & Answers

Using gunzip to decompress .zip file

Hi, I have a zipped Oralce software (linux.x64_11gR1_database.zip) and I need to unzip it. On the Linux server, I only see the gunzip utility listed: $ ls -ltr *zip* -rwxr-xr-x 3 root root 60320 Jan 15 2008 gzip -rwxr-xr-x 3 root root 60320 Jan 15 2008 gunzip Can I use the command... (1 Reply)
Discussion started by: syang68
1 Replies

6. UNIX for Dummies Questions & Answers

Issue: Compress in unix server and FTP to windows and open the compress file using Winzip

Hi All ! We have to compress a big data file in unix server and transfer it to windows and uncompress it using winzip in windows. I have used the utility ZIP like the below. zip -e <newfilename> df2_test_extract.dat but when I compress files greater than 4 gb using zip utility, it... (4 Replies)
Discussion started by: sakthifire
4 Replies

7. Shell Programming and Scripting

Decompress (with gunzip) recursively, but do not delete original gz file

Hi all, I have a folder hierarchy with many gz files in them. I would like to recursively decompress them, but keep the original files. I would also like to move all the decompressed files (these are very large HDF5 files with .CP12 extension) to another data folder. Currently I am using four... (3 Replies)
Discussion started by: gansvv
3 Replies

8. UNIX for Dummies Questions & Answers

Please, I want to decompress a file.bin "firmware"

Please, help me Please, I want to decompress a file firmware for a 2000 SAT HD Please note that I use Version ubuntu 10.04 lts file name : .................. NxpRom.bin .................. Or How do I use and is... (0 Replies)
Discussion started by: samy2012
0 Replies

9. Shell Programming and Scripting

Tar to decompress and to convert file to .dat format

tar -tvf abc.tar.gz gives me the file name abc.Is it possible to rename the file to abc.dat while decompressing using tar ? Thanks. (2 Replies)
Discussion started by: vedanta
2 Replies
ETCUPDATE(8)						    BSD System Manager's Manual 					      ETCUPDATE(8)

NAME
etcupdate -- update the configuration and startup files in /etc SYNOPSIS
etcupdate [-ahlv] [-p pager] [-s {srcdir | tgzdir | tgzfile}] [-t temproot] [-w width] DESCRIPTION
etcupdate is a tool that lets the administrator update the configuration and startup files in /etc (and some other directories like /dev, /root and /var) without having to manually check and modify every file. The administrator should run this script after performing an operat- ing system update (e.g. after running make build in /usr/src or after extracting new binary distribution files) to update to the latest con- figuration and startup files. etcupdate compares the new configuration files against the currently installed files. The user is given the option of installing, merging or deleting each modified or missing file. The user can also view the differences between the files. By default, it shows the differences in the unified diff format. The default format can be toggled to show the differences in unified, context, or side by side formats or an user- defined command may be used to view differences. (And if wdiff is installed, it can also show differences on a word by word basis.) etcupdate also detects if the user installs certain special files and performs corresponding tasks like remaking device nodes or rebuilding a database from the aliases(5) file. Finally, etcupdate runs postinstall(8) to check the results. etcupdate needs a clean set of new configuration files to compare the existing files against. These files, called the ``reference files'' in this manual, may be derived from either a source or binary distribution of NetBSD. If the user is updating from sources (which is the default mode), etcupdate will first create a copy of the reference files by running make distribution in /usr/src/etc, installing the files to a so-called temproot. (See usage of the -s srcdir and -t temproot options later in this manual page.) Although this is the default mode, it is not recommended (see the ``BUGS'' section). Instead of using sources, it is recommended that the user should extract one or more binary distribution sets in a special location and use those as the reference files (see usage of the -s tgzdir option later in this manual page), or specify one or more binary distribution sets directly (see usage of the -s tgzfile option later in this manual page). The following options are available: -a etcupdate can automatically update files which have not been modified locally. The -a flag instructs etcupdate to store MD5 checksums in /var/etcupdate and use these checksums to determine if there have been any local modifications. -h Prints a help text. -l Automatically skip files with unchanged RCS IDs. This has the effect of leaving alone files that have been altered locally but which have not been changed in the reference files. Since this works using RCS IDs, files without RCS IDs will not be skipped even if only modified locally. This flag may be used together with the -a flag described above. -p pager The pager to use when displaying files. By default this is more(1) but it can be changed either with this option or by defin- ing the PAGER variable. -s {srcdir | tgzdir | tgzfile} The location of the reference files, or the NetBSD source files used to create the reference files. This may be specified in one of three ways: -s srcdir The top level directory of the NetBSD source tree. By default this is /usr/src but it can be changed either with this option or the SRCDIR variable. The reference files will be created by running ``make distribution'' in the srcdir/etc directory. Note that srcdir should refer to the top of the source directory tree; earlier versions of etcupdate expected srcdir to refer to the etc subdirectory within the source tree. -s tgzdir A directory in which reference files have been extracted from a binary distribution of NetBSD. The files that are distributed in the ``etc.tgz'' set file must be present. The files that are distributed in the ``xetc.tgz'' set file are optional. The reference files from the specified directory will be copied to the temproot directory. -s tgzfile The location of a set file (or ``tgz file'') such as ``etc.tgz'' or ``xetc.tgz'' from a binary distribution of NetBSD. Each set file is a compressed archive containing reference files, which will be extracted to the temproot directory. Multiple -s options may be used to specify multiple set files. The ``etc.tgz'' set file must be specified. The ``xetc.tgz'' set file is optional. -t temproot Specifies the location of the temproot directory. This directory will be used for a temporary copy of the reference files created by running ``make distribution'' in the source directory specified by -s srcdir, or a temporary copy of the reference files extracted from the binary sets specified by -s tgzfile, or a temporary copy of the reference files from the directory specified by -s tempdir. By default this is /tmp/temproot but can be changed either with this option or the TEMPROOT environ- ment variable. -v Makes etcupdate verbose about its actions. -w width Sets screen width used during interactive merge. By default this is the number of columns stty(1) reports but it can be changed either with this option or by defining the WIDTH variable. This is useful for xterm(1) users with wider shell win- dows. ENVIRONMENT
TEMPROOT Sets a default value for temproot. See -t above. SRCDIR The location of the NetBSD sources files. See -s above. PAGER The pager to use when displaying files. See -p above. WIDTH The screen width used during interactive merge. See -w above. IGNOREFILES A list of files that etcupdate should ignore. Files listed in this variable will never be considered for updating by etcupdate. FILES
The environment variables can also be defined in the following configuration files. The user's personal configuration file settings override the global settings. /etc/etcupdate.conf ~/.etcupdaterc EXAMPLES
You have just upgraded your NetBSD host from 3.0 to 4.0 and now it's time to update the configuration files as well. To update the configu- ration files from the sources (if you have the /usr/src/etc directory): etcupdate The default location of the source files is /usr/src but this may be overridden with the -s srcdir command line argument: etcupdate -s /some/where/src To update the configuration files from binary distribution sets do something like this: etcupdate -s /some/where/etc.tgz -s /some/where/xetc.tgz or like this: mkdir /tmp/temproot cd /tmp/temproot tar -xpzf /some/where/etc.tgz tar -xpzf /some/where/xetc.tgz etcupdate -s /tmp/temproot You have modified only few files in the /etc directory so you would like install most of the updates without being asked. To automatically update the unmodified configuration files: etcupdate -a To get a better idea what's going on, use the -v flag: etcupdate -v SEE ALSO
cmp(1), more(1), rcs(1), sdiff(1), stty(1), aliases(5), postinstall(8) HISTORY
The etcupdate command appeared in NetBSD 1.6. In NetBSD 4.0, the -s tgzfile option was added, the -b tempdir option was converted to -s tgzdir, and the -s srcdir option was changed to refer to the top of the source directory tree rather than to the etc subdirectory. In NetBSD 5.0, the ability to specify multiple colon-separated files with a single -s option was deprecated, and options deprecated in NetBSD 4.0 were removed. AUTHORS
The script was written by Martti Kuparinen <martti@NetBSD.org> and improved by several other NetBSD users. The idea for this script (including code fragments, variable names etc.) came from the FreeBSD mergemaster (by Douglas Barton). Unlike the FreeBSD mergemaster, this does not use CVS version tags by default to compare if the files need to be updated. Files are compared with cmp(1) as this is more reliable and the only way if the version numbers are the same even though the files are different. BUGS
If a source directory is specified via the ``-s srcdir'' option (or if the /usr/src directory is used by default), then etcupdate will run ``make distribution'' in the etc subdirectory of the source directory, but it will not use the same options or environment variables that would be used during a full build of the operating system. For this reason, use of the ``-s srcdir'' option is not recommended, and use of the ``-s tgzdir'' or ``-s tgzfile'' options is recommended. BSD
October 4, 2008 BSD
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy