Dear All,
I have text file like this:
Header
Record 1
Record 2
.......
Record n
Tail
This line of code :
awk '{ if ( NR == 1 ) { head=substr($0,1,300);} else { last = substr($0,1,300);}END{printf "Header is : %-300s Trailer is : %-300s\n", head, last}' filename
converted Header... (11 Replies)
Guys,
My log files stored in the date format format below(log_20080714072942):
TIMESTAMP=`date +%Y%m%d%H%M%S`
LOG=/log/log_${TIMESTAMP}.log
I'm looking for a shell script which deletes all files which is older than 3 months from today.
Regards,
Bhagat (3 Replies)
Hi,
I am trying to write a shell script to delete logs generate by db when space in the folder reaches 70%. i am getting space values from db, find the files at OS and remove them by using a cron job runs every 5minutes.
I have to keep the latest 5 files at any time, my problem is that log files... (3 Replies)
Need to
1. archive all the files in a directory from the previous month into a tar/gz file, ignoring all already archived 'tar.gz' files
2. Check created .tar.gz file isnt corrupted and has all the required files in it. and then remove the original files.
I am using a function to get the... (1 Reply)
I want to use my script to get any file then delete it once it transfers to my side , I manage to create below script to generate "list" file which contains all file names in "10.10.1.1" then I made "a.out" file which contains the commands that I want to run it on "10.10.1.1" to get & delete the... (2 Replies)
Hi
My directory structure is as below.
dir1, dir2, dir3
I have the list of files to be deleted in the below path as below.
/staging/retain_for_2years/Cleanup/log $ ls -lrt
total 0
drwxr-xr-x 2 nobody nobody 256 Mar 01 16:15 01-MAR-2015_SPDBS2
drwxr-xr-x 2 root ... (2 Replies)
ENVIROMENT
Linux: RHEL 6.4
Log Path: /usr/iplanet/servers/https-company/logs
Log Format: user.log.03-15-2015
I have log4j log rotation enabled rotating files on a daily basis.
The rotated logs are NOT compressed & are taking up too much space.
I need a script that will run daily that... (1 Reply)
Hello All !
I need your help on this case,
I have a csv file with this:
ITEM105;ARI FSR;2016-02-01 08:02;243
ITEM101;ARI FSR;2016-02-01 06:02;240
ITEM032;RNO TLE;2016-02-01 11:03;320
ITEM032;RNO TLE;2016-02-02 05:43;320
ITEM032;RNO TLE;2016-02-01 02:03;320
ITEM032;RNO... (2 Replies)
Hi All,
Do you have any sample script,
- auto get file from SFTP remote server and delete file in remove server after downloaded.
- only download specify filename
- auto upload file from local to SFTP remote server and delete local folder file after uploaded
- only upload specify filename
... (3 Replies)
Discussion started by: weesiong
3 Replies
LEARN ABOUT CENTOS
zip_fopen
ZIP_FOPEN(3) Library Functions Manual ZIP_FOPEN(3)NAME
zip_fopen , - .Nm zip_fopen_index open file in zip archive for reading
LIBRARY
libzip (-lzip)
SYNOPSIS
#include <zip.h>
struct zip_file * zip_fopen(struct zip *archive, const char *fname, int flags);
struct zip_file * zip_fopen_index(struct zip *archive, zip_uint64_t index, int flags);
DESCRIPTION
The zip_fopen function opens the file name fname in archive. The flags argument specifies how the name lookup should be done, according to
the values are described in zip_name_locate(3). Also, the following values may be or'ed to it.
ZIP_FL_COMPRESSED Read the compressed data. Otherwise the data is uncompressed by zip_fread.
ZIP_FL_UNCHANGED Read the original data from the zip archive, ignoring any changes made to the file.
The zip_fopen_index function opens the file at position index.
If encrypted data is encountered, the functions call zip_fopen_encrypted(3) or zip_fopen_index_encrypted(3) respectively, using the default
password set with zip_set_default_password(3).
RETURN VALUES
Upon successful completion, a
struct zip_file pointer is returned. Otherwise, NULL is returned and the error code in archive is set to indicate the error.
ERRORS
[ZIP_ER_CHANGED]
The file data has been changed.
[ZIP_ER_COMPNOTSUPP]
The compression method used is not supported.
[ZIP_ER_ENCRNOTSUPP]
The encryption method used is not supported.
[ZIP_ER_MEMORY]
Required memory could not be allocated.
[ZIP_ER_READ]
A file read error occurred.
[ZIP_ER_SEEK]
A file seek error occurred.
[ZIP_ER_ZLIB]
Initializing the zlib stream failed.
The function zip_fopen may also fail and set for any of the errors specified for the routine zip_name_locate(3).
The function zip_fopen_index may also fail with ZIP_ER_INVAL if index is invalid.
SEE ALSO libzip(3), zip_fclose(3), zip_fread(3), zip_get_num_entries(3), zip_name_locate(3), zip_set_default_password(3)AUTHORS
Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
NiH February 14, 2011 ZIP_FOPEN(3)