Sponsored Content
Top Forums Shell Programming and Scripting Shell Script to zip users cmd history log files Post 302595059 by hedkandi on Thursday 2nd of February 2012 02:52:39 AM
Old 02-02-2012
It's a directory

Code:
[root@H99 ~]# ls -ld /var/log/user_history/old_logs/02
drwxr-xr-x 2 root root 4096 Feb  1 14:52 /var/log/user_history/old_logs/02
[root@H99 ~]# date
Thu Feb  2 16:48:38 JST 2012

I've created all the folders in the script I provided in the post above, but how do I create a subsequent directory according to the next month

e.g 03 for March, 04 for April...

So the end results would be like this

1. all the *history files from /var/log/user_history/ dumped into something like this:

Code:
/var/log/user_history/old_logs/02/*gz
/var/log/user_history/old_logs/03/*gz
/var/log/user_history/old_logs/04/*gz


Last edited by hedkandi; 02-02-2012 at 03:53 AM.. Reason: removed server name
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bourne Shell script - log for users loggin on and off

Hello all, I'm new to shell scripting and want to make a script that I can write to log the users logging on and off the a unix system. I have had a good look over the past few days to crack it, I think I am getting close. I want a script that runs an infinite loop to check every 5 seconds... (14 Replies)
Discussion started by: noodlesoup
14 Replies

2. Shell Programming and Scripting

batch shell script to zip individual files in directory - help

help trying to figure out a batch shell script to zip each file in a directory into its own zip file using this code but it does not work tryed this also nothing seems to work , just ends without zipping any files i have over 3000 files i need to zip up individualy ... (7 Replies)
Discussion started by: wingchun22
7 Replies

3. Shell Programming and Scripting

open terminal to run cmd using shell script

i want the shell script to open the terminal and in that terminal i want to run a command specified in the script... how can it be done... (2 Replies)
Discussion started by: chandrabhushan
2 Replies

4. Shell Programming and Scripting

To write a shell script which groups files with certain pattern, create a tar and zip

Hi Guru's, I have to write a shell script which groups file names based upon the certain matching string pattern, then creates the Tar file for that particular group of files and then zips the Tar file created for the respective group of files. For example, In the given directory these files... (3 Replies)
Discussion started by: rahu_sg
3 Replies

5. UNIX for Dummies Questions & Answers

How to zip up a series of log files in one shot?

Hi, I'm trying to zip up the first half year's application logs into one zip file. The logs are in the format of log.2011-01-01 to log.2011-06-30. I tried to use this command at ksh: zip logs.jan-jun2011.zip *2011-01* *2011-02* *2011-03* *2011-04* *2011-05* *2011-06* It works. However, I... (4 Replies)
Discussion started by: hyang
4 Replies

6. Shell Programming and Scripting

Shell script for to view all users & groups history in root

Dear All, I want to know all users & group history in one file, for root terminal through shell or any other option (5 Replies)
Discussion started by: kpoobathi
5 Replies

7. Shell Programming and Scripting

how to use reset_server (siebel server) cmd in shell script

hello frnds, im using a script to stop, reset and to start the siebel server.. i'm able to extract the enterprise name, siebel server name and siebel root path.. when i try to use these info in the script im unable to perform the reset_server -r <siebel root> -e <enterprise name> +-M... (3 Replies)
Discussion started by: kaushik_87
3 Replies

8. UNIX for Dummies Questions & Answers

[Solved] History cmd

When using the history cmd it appears to be limited to the last 16 lines. Is it possible to increase this limit? (6 Replies)
Discussion started by: nosuchluck
6 Replies

9. Shell Programming and Scripting

Using Shell Script in place of Perl script to Unzip the zip files.

Hi Expert, We have some shell scripts which Internally uses Perl Script to Unzip the source zip files which comes to inbound directory. So now our requirement is to avoid the dependency on Perl Script and us Shell Script to unzip the files. I have the Perl script with me attached can some one... (3 Replies)
Discussion started by: naveen.dasu
3 Replies

10. UNIX for Beginners Questions & Answers

How to zip csv files having specific pattern in a directory using UNIX shell script?

I have files in a Linux directory . Some of the file is listed below -rw-rw-r--. 1 roots roots 0 Dec 23 02:17 zzz_123_00000_A_1.csv -rw-rw-r--. 1 roots roots 0 Dec 23 02:18 zzz_121_00000_A_2.csv -rw-rw-r--. 1 roots roots 0 Dec 23 02:18 zzz_124_00000_A_3.csv drwxrwxr-x. 2 roots roots 6 Dec 23... (4 Replies)
Discussion started by: Balraj
4 Replies
zipnote(1)						      General Commands Manual							zipnote(1)

NAME
zipsplit - split a zipfile into smaller zipfiles SYNOPSIS
zipsplit [-t] [-i] [-p] [-s] [-n size] [-r room] [-b path] [-h] [-v] [-L] zipfile ARGUMENTS
zipfile Zipfile to split. OPTIONS
-t Report how many files it will take, but don't make them. -i Make index (zipsplit.idx) and count its size against first zip file. -n size Make zip files no larger than "size" (default = 36000). -r room Leave room for "room" bytes on the first disk (default = 0). -b path Use path for the output zip files. -p Pause between output zip files. -s Do a sequential split even if it takes more zip files. -h Show a short help. -v Show version information. -L Show software license. DESCRIPTION
zipsplit reads a zipfile and splits it into smaller zipfiles. EXAMPLES
To be filled in. BUGS
Does not yet support large (> 2 GB) or split archives. SEE ALSO
zip(1), unzip(1) AUTHOR
Info-ZIP v3.0 of 8 May 2008 zipnote(1)
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy