Sponsored Content
Top Forums Shell Programming and Scripting Bash Script to Compress All Subdirectories Post 302596852 by Corona688 on Wednesday 8th of February 2012 12:03:09 PM
Old 02-08-2012
Since you have BASH, I presume you have linux.

Code:
find . -type d -mindepth 1 -maxdepth 1 | while read DIR
do
        echo tar -zcf "$DIR.tar.gz" "${DIR}"
done

Remove the 'echo' once you know it does what you want.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

compress script

Hi, How wud I script a particular log file to be compressed at a particular time and to be uncompressed after say 2 hours ? Im on a aix 3.2 box . file to be compressed --- > # pwd # /zssps/sps06/slogfile Thanks (3 Replies)
Discussion started by: cubicle^dweller
3 Replies

2. Shell Programming and Scripting

script needed for compress

i hav 200 logs files in a folder i want compress only the files having size more than 10 mb . please provide a script (1 Reply)
Discussion started by: kingkhankk
1 Replies

3. Shell Programming and Scripting

script in saved in compress format

hi please help me i have scripts saved in compress format in sever Cherrs naveen.g (1 Reply)
Discussion started by: naveeng.81
1 Replies

4. 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

5. Shell Programming and Scripting

Bash: Gzip files in Directory and itīs Subdirectories

Hello dear Community, I have a task to wrtie a script which will gzip not zipped files in a directory and itīs subdirectories. I succeeded in gzippung the directory but not the subdirectories: #/bin/bash #go to the directory where to zip cd $1 #Zip unzipped files for i in `ls | xargs... (2 Replies)
Discussion started by: JamesCarter
2 Replies

6. Shell Programming and Scripting

Compress files as per timestamp in multiple subdirectories

I'd really appreciate if anyone could assist me with this code A directory with multiple subdirectories has multiple files which are timestamp'ed. We need to - compress files as per timestamp - save compressed file/s in the respective folder - delete the source files ============... (2 Replies)
Discussion started by: sreewin7
2 Replies

7. Shell Programming and Scripting

Need script to compress the file for yesterday.

Hi, I want to write script for the last 5 files to compress. #!/bin/sh a= ls -ltr | awk '{print $9}' | head -5 | tail -3 echo `compress $a` exit 0 but this was telling "not found" please modify the script if i am wrong. (5 Replies)
Discussion started by: victory
5 Replies

8. Shell Programming and Scripting

Bash script deleting my files, and editing files in subdirectories question

#!/bin/bash # name=$1 type=$2 number=1 for file in ./** do if then filenumber=00$number elif then filenumber=0$number fi tempname="$name""$filenumber"."$type" if (4 Replies)
Discussion started by: TheGreatGizmo
4 Replies

9. Shell Programming and Scripting

Bash script monitor directory and subdirectories for new pdfs

I need bash script that monitor folders for new pdf files and create xml file for rss feed with newest files on the list. I have some script, but it reports errors. #!/bin/bash SYSDIR="/var/www/html/Intranet" HTTPLINK="http://TYPE.IP.ADDRESS.HERE/pdfs" FEEDTITLE="Najnoviji dokumenti na... (20 Replies)
Discussion started by: markus1981
20 Replies

10. Shell Programming and Scripting

Bash to create new directory by date followed by identifier and additional subdirectories

I have a bash that downloads a list and if that list has data in it then a new main directory is created (with the date) with several subdirectories (example1, example2, example3). My question is in that list there are portion of specific file types (.vcf.gz) - identifier towards the end that have... (0 Replies)
Discussion started by: cmccabe
0 Replies
MM-COMMON-PREPARE(1)						  mm-common 0.9.5					      MM-COMMON-PREPARE(1)

NAME
mm-common-prepare - Prepare a C++ binding module to use mm-common SYNOPSIS
mm-common-prepare [OPTION]... [SOURCE-DIR] DESCRIPTION
Run mm-common-prepare to install the mm-common build support files into the source tree of a C++ binding module. The exact location where these files will be installed can be influenced through special macros in the configure.ac file. AC_CONFIG_AUX_DIR([AUX-DIR]) The Automake include files are placed into the AUX-DIR subdirectory of the top-level source directory. If AC_CONFIG_AUX_DIR is not specified, the files are placed at the top-level of the module's source tree. MM_CONFIG_DOCTOOL_DIR([DOCTOOL-DIR]) If the MM_CONFIG_DOCTOOL_DIR macro is called with an explicit DOCTOOL-DIR argument, the common utilities required for generating and installing the reference documentation of a C++ binding module will be installed into the named subdirectory. If MM_CONFIG_DOC- TOOL_DIR is not used or does not specify a DOCTOOL-DIR argument, mm-common-prepare will not install the documentation utility files into the module's source tree. Instead, it is assumed that the module depends on glibmm and can use the installed documentation utilities that come with it. If no SOURCE-DIR argument has been specified on the command line, the current working directory will be used. OPTIONS
-c, --copy copy files instead of creating symbolic links to them -f, --force forcefully replace existing files or symbolic links --help display a help message and exit --version show version information and exit EXIT STATUS
The exit status is 0 if OK, or 1 if an error occurred. FILES
The build support files currently installed by mm-common-prepare are listed below. Automake include files installed into AUX-DIR: compile-binding.am dist-changelog.am doc-reference.am generate-binding.am Documentation utilities installed into DOCTOOL-DIR: doc-install.pl doc-postprocess.pl doxygen.css tagfile-to-devhelp2.xsl SEE ALSO
autoreconf(1) /usr/share/doc/mm-common/README /usr/share/doc/mm-common/skeletonmm.tar.gz GNOME
2009-12-29 MM-COMMON-PREPARE(1)
All times are GMT -4. The time now is 06:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy