Sponsored Content
Full Discussion: Zip a file with path
Top Forums Shell Programming and Scripting Zip a file with path Post 302746681 by Froob on Wednesday 19th of December 2012 09:36:07 PM
Old 12-19-2012
i want to compress a specific file
zip /var/log/mrnet.log (into mrnet.log.1.gz)
is it possible
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

unzip .zip file and list the files included in the .zip archive

Hello, I am trying to return the name of the resulting file from a .zip archive file using unix unzip command. unzip c07212007.cef7081.zip Archive: c07212007.cef7081.zip SecureZIP for z/OS by PKWARE inflating: CEP/CEM7080/PPVBILL/PASS/G0063V00 I used the following command to unzip in... (5 Replies)
Discussion started by: oracledev
5 Replies

2. Shell Programming and Scripting

Get zip path from unzip -l

I am listing the contents of a zip file and then grepping for a specific string ie: filename.a to get a line like: 309753 10-18-08 15:20 etc/filename.a The etc/filename.a is the path the file is at within the zip file...how might I capture this path as I want to use that path to unzip that... (2 Replies)
Discussion started by: phreezr
2 Replies

3. Linux

How to create zip file without path?

Hello, I have generated a PHP script that creates files needed for EPUB file. I have a temp directory where these files are created into and then needs to be zipped. The directory structure is: mimetype content.opf index.html stylesheet.css toc.ncx META-INF META-INF/container.xml ... (4 Replies)
Discussion started by: spaze
4 Replies

4. AIX

ZIP multiple files and also specify size of zip file

I have to zip many pdf files and the size of zip file must not exceed 200 MB. When size is more than 200 MB then multiple zip files needs to be created. How we can achieve this in UNIX? I have tried ZIP utility but it takes a lot of time when we add individual pdfs by looping through a... (1 Reply)
Discussion started by: tom007
1 Replies

5. UNIX for Dummies Questions & Answers

Zip a file with .zip extension.

Hi, I need to zip a .dat file with .zip extension. I tried using the "zip" command. But shell says. "ksh: zip: not found" Currently I am using gunzip to zip and changing the extension ".gz" to ".zip" as follows. mv $file `echo $file | sed 's/\(.*\.\)gz/\1zip/'` But when I tried... (1 Reply)
Discussion started by: aeroticman
1 Replies

6. Shell Programming and Scripting

Find file and zip without including directory path

Does anyone know of a way to zip the resulting file from a find command? My approach below finds the file and zips the entire directory path, which is not what I need. After scanning the web, it seems to be much easier to perform gzip, but unfortunately the approach must use zip. find `$DIR`... (5 Replies)
Discussion started by: koeji
5 Replies

7. Shell Programming and Scripting

Zip Multiple files to One .zip file in AIX system

Hi I have a requirement in unix shell where I need to zip multiple files on server to one single .zip file. I dont see zip command in AIX and gzip command not doing completely what I want. One I do .zip file, I should be able to unzip in my local Computer. Here is example what I want... (9 Replies)
Discussion started by: RAMA PULI
9 Replies

8. Linux

Unable to ZIP without path

We have been trying to zip a file with a Jenkins linux build server with a network path. We were trying use the different options for zip. We either get the full directory path with zip -r option or no directory with zip -j We need just the main path without the network path:example: /Documents... (2 Replies)
Discussion started by: Kenp11
2 Replies

9. UNIX for Beginners Questions & Answers

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (2 Replies)
Discussion started by: b.saipriyanka
2 Replies

10. Shell Programming and Scripting

How can we Zip multiple files created on the same date into one single zip file.?

Hi all i am very new to shell scripting and need some help from you to learn 1)i have some log files that gets generated on daily basis example: i have abc_2017_01_30_1.log ,2017_01_30_2.log like wise so i want to zip this 4 logs which are created on same date into one zip folder. 2)Post zipping... (1 Reply)
Discussion started by: b.saipriyanka
1 Replies
appender_type_stream2.h(3)					       log4c						appender_type_stream2.h(3)

NAME
appender_type_stream2.h - Log4c stream2 appender interface. SYNOPSIS
#include <log4c/defs.h> #include <log4c/appender.h> Functions LOG4C_API void log4c_stream2_set_fp (log4c_appender_t *a_this, FILE *fp) LOG4C_API FILE * log4c_stream2_get_fp (log4c_appender_t *a_this) LOG4C_API void log4c_stream2_set_flags (log4c_appender_t *a_this, int flags) LOG4C_API int log4c_stream2_get_flags (log4c_appender_t *a_this) Variables __LOG4C_BEGIN_DECLS LOG4C_API const log4c_appender_type_t log4c_appender_type_stream2 Detailed Description Log4c stream2 appender interface. The stream2 appender uses a file handle FILE* for logging. It can be used with stdout, stderr or a normal file. It is pretty primitive as it does not do file rotation, or have a maximum configurable file size etc. It improves on the stream appender in a few ways that make it a better starting point for new stream based appenders. It enhances the stream appender by allowing the default file pointer to be used in buffered or unbuffered mode. Also when you set the file pointer stream2 will not attempt to close it on exit which avoids it fighting with the owner of the file pointer. stream2 is configured via setter functions--the udata is not exposed directly. This means that new options (eg. configure the open mode ) could be added to stream2 while maintaining backward compatability. The appender can be used with default values, for example as follows: log4c_appender_t* myappender; myappender = log4c_appender_get('/var/logs/mylog.log'); log4c_appender_set_type(myappender,log4c_appender_type_get('stream2')); In this case the appender will be configured automatically with default values: o the filename is the same as the name of the appender, '/var/logs/mymlog.log' o the file is opened in 'w+' mode o the default system buffer is used (cf; setbuf() ) in buffered mode The stream2 appender can be configured by passing it a file pointer to use. In this case you manage the file pointer yourself--open, option setting, closing. If you set the file pointer log4c will not close the file on exiting--you must do this: log4c_appender_t* myappender; FILE * fp = fopen('myfile.log', 'w'); myappender = log4c_appender_get('myappender'); log4c_appender_set_type(myappender, log4c_appender_type_get('stream2')); log4c_stream2_set_fp(stream2_appender,myfp); The default file pointer can be configured to use unbuffered mode. Buffered mode is typically 25%-50% faster than unbuffered mode but unbuffered mode is useful if your preference is for a more synchronized log file: log4c_appender_t* myappender; myappender = log4c_appender_get('/var/logs/mylog.log'); log4c_appender_set_type(myappender,log4c_appender_type_get('stream2')); log4c_stream2_set_flags(myappender, LOG4C_STREAM2_UNBUFFERED); Function Documentation LOG4C_API int log4c_stream2_get_flags (log4c_appender_t *a_this) Get the flags for this appender. Parameters: this a pointer to the appender Returns: the flags for this appender. returns -1 if there was a problem. LOG4C_API FILE* log4c_stream2_get_fp (log4c_appender_t *a_this) Get the file pointer for this appender. Parameters: this a pointer to the appender Returns: the file pointer for this appender. If there's a problem returns NULL. LOG4C_API void log4c_stream2_set_flags (log4c_appender_t *a_this, intflags) Set the flags for this appender. Parameters: this a pointer to the appender flags ar teh flags to set. These will overwrite the existing flags. Currently supported flags: LOG4C_STREAM2_UNBUFFERED LOG4C_API void log4c_stream2_set_fp (log4c_appender_t *a_this, FILE *fp) Set the file pointer for this appender. Parameters: this a pointer to the appender fp the file pointer this appender will use. The caller is responsible for managing the file pointer (open, option setting, closing). Variable Documentation __LOG4C_BEGIN_DECLS LOG4C_API const log4c_appender_type_t log4c_appender_type_stream2 Stream2 appender type definition. This should be used as a parameter to the log4c_appender_set_type() routine to set the type of the appender. Author Generated automatically by Doxygen for log4c from the source code. Version 1.2.1 Mon May 2 2011 appender_type_stream2.h(3)
All times are GMT -4. The time now is 12:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy