Sponsored Content
Top Forums Shell Programming and Scripting Problem in compressing and moving files Post 302945689 by swasid on Monday 1st of June 2015 02:19:38 PM
Old 06-01-2015
Trying out a simpler version this time with:

Code:
#!/bin/ksh

SOURCE_DIR="/abc/src"
DEST_DIR="/abc/src/dest"

cd $SOURCE_DIR

for FILENAME in xxx yyy zzz
do
    SRC_FILE="$SOURCE_DIR/$TSTENV-${FILENAME}*"
    gzip ${SRC_FILE}
    chmod 644 ${SRC_FILE}.gz
    mv ${SRC_FILE}.gz ${DEST_DIR}
done

I am trying to build the file pattern here where $TSTENV will translate to mach01, the name of the machine after which the files can be in any of the below given formats:

Code:
mach01-zzz~rem_plg~1.log
mach01-xxx-yyy~1.log
mach01-yyy~1.log
mach01-yyy~1.log.15-05-26_20:29:40

Basically I want anything after mach01-xxx or mach01-yyy or mach01-zzz to be zipped and sent. From the code written above, it is doing the compression in the source folder but is there a way I can remove the below message when it is run the second time?

Code:
gzip: /abc/src/mach01-xxx-yyy~1.log.gz already has .gz suffix -- unchanged

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Compressing files from DOS to Unix

As the title sugests I need to compress files from DOS to Unix. The files should be in .Z format, as created using 'compress' in an Unix environment. Ligs (2 Replies)
Discussion started by: ligs
2 Replies

2. UNIX for Dummies Questions & Answers

Compressing files

I have never used this command before. I need to use the "compress" command to compress all files located in the subdirectories under the following directories: /home/ftp/inbound/Fordin Please advise, I appreciate your help. Thanks, Syed (3 Replies)
Discussion started by: sh9492
3 Replies

3. UNIX for Dummies Questions & Answers

compressing two files in a script

Hi, i have written a script in unix which produces two files(.csv file) at the end. Now i want to add these to files in a zip file and send the zip file across the network by FTP. Problem is that i dunno how to make a single zip file containing the two files that have been created by the script.... (1 Reply)
Discussion started by: nimish
1 Replies

4. UNIX for Advanced & Expert Users

Problem in moving files to .txt

Hello All Iam running one script to Split the file and rename it with .txt extension Script Prefix=Z_PRICE_NEW_`date "+%Y%m%d%H%M%S"` split -3000 -a 4 Z_PRICE_NEW.txt $Prefix find . -name "$Prefix*" -print | { while read FILE; do mv $FILE $FILE.tmp done } Since the Source file was... (2 Replies)
Discussion started by: mohdtausifsh
2 Replies

5. UNIX for Advanced & Expert Users

Compressing files on NAS mount

Hello, I am having difficulty compressing the files using compress or GZIP utility on NAS share NFS mounted on my linux server. Any one have idea on how to do this ? I get the followign error but the trying to compress the files STRP2> compress STR_OUTBOUND_CDM_LOG_LOB.PRT2008_26.txt... (1 Reply)
Discussion started by: kamathg
1 Replies

6. UNIX for Dummies Questions & Answers

Compressing of log files

Hello All My first post in the forum. :) I've this huge log files of size 20GB-30 GB in my unix server. I want to analyse the log file for some error messages. But because of the enormity of the size of these files i'm not able to grep/search the pattern in the file . Also, tried to gzip the... (1 Reply)
Discussion started by: sgbhat
1 Replies

7. Shell Programming and Scripting

What is the code for compressing files using pkzip ?

hi everyone , Can someone provide me a shell program to compress and decompress files using gzip , i dont know anything in shell programming , this code is a part of my project. So can someone help with me the code ? (2 Replies)
Discussion started by: mig23
2 Replies

8. Shell Programming and Scripting

Compressing files

I need help to do a script that will compress a file that's bigger than 5000 octets and won't overwrite the previous compress file. lets say I have mylogfile.log and I would compress it I would become mylogfile. 1. log and if I would compress again mylogfile.log it would be mylogfile. 2.... (8 Replies)
Discussion started by: Froob
8 Replies

9. Shell Programming and Scripting

Getting latest files and compressing from a textfile

I'm doing a cleanup script for a directory using KSH. I'm keeping the file name prefixes in a text file. In a KSH, I want to read the prefix from the file, and match the pattern of the file and keep and compress(.Z) the latest 4 versions of the matched files in the directory. And I want to delete... (1 Reply)
Discussion started by: manchimahesh
1 Replies

10. UNIX for Beginners Questions & Answers

Logrotate and Compressing only yesterdays files

Hello, I have a syslog server at home and am currently experiencing an issue where my logs will rotate and compress however it will rotate and compress yesterdays file and the newly created log file for the current day. When it does this however it will also create another new file for today... (9 Replies)
Discussion started by: MyUserName7000
9 Replies
monodocs2html(1)					      General Commands Manual						  monodocs2html(1)

NAME
monodocs2html - Translate Monodoc XML to HTML SYNOPSIS
monodocs2html -source:SOURCE_DIR -dest:DEST_DIR [OPTIONS]* DESCRIPTION
monodocs2html has been obsoleted by mdoc(1). See the mdoc-export-html(1) man page. monodocs2html is a program that creates HTML documentation from the Monodoc documentation XML files. OPTIONS
-dest:DEST_DIR Write the HTML files into the directory DEST_DIR . -dumptemplate Dump the default page template to standard output so that you can use it as a base for a new template for use with the -template option. -ext:FILE_EXTENSION FILE_EXTENSION is the file extension for generated files. This defaults to html . -?, -help Show program argument information. -onlytype:TYPE Only generate HTML for the type TYPE . -source:SOURCE_DIR SOURCE_DIR is the base directory containing the Monodoc XML documentation. This directory should contain an index.xml file, the namespace-name.xml files (one for each namespace), and namespace-name directo- ries (one for each namespace), which will contain the type.xml files holding the monodoc documentation. -template:TEMPLATE Generate HTML using the page template TEMPLATE . -V, -version Display version and licensing information. TEMPLATE FORMAT
The template file is an XSLT which needs to process the following input XML document: <Page> <CollectionTitle>Collection Title</CollectionTitle> <PageTitle>Page Title</PageTitle> <Summary>Page Summary</Summary> <Signature>Type Declaration</Signature> <Remarks>Type Remarks</Remarks> <Members>Type Members</Members> <Copyright>Documentation Copyright</Copyright> </Page> The generated HTML also makes use of the following CSS classes, which should be defined so that output is nicely formatted: .CollectionTitle .PageTitle .Summary .Signature .Remarks .Members .Copyright .Section .SectionBox .NamespaceName .NamespaceSummary .MemberName .MemberSignature .MemberBox .Subsection .SubsectionBox .SignatureTable .EnumerationsTable .CodeExampleTable .MembersListing .TypesListing .InnerSignatureTable .TypePermissionsTable HTML LINKS
All members within the HTML file have a id attribute to permit linking to a specific member. The value of the id attribute is the String ID of the specified member. See the STRING ID FORMAT section of the monodocer man page for more information. MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. WEB SITE
Visit http://www.mono-project.com for details monodocs2html(1)
All times are GMT -4. The time now is 09:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy