Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Script to zip users cmd history log files

by hedkandi (Initiate)
on Feb 02, 2012 at 06:14 UTC ( [id://951365]=perlquestion: print w/replies, xml ) Need Help??

hedkandi has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Script to zip users cmd history log files
by Anonymous Monk on Feb 02, 2012 at 09:01 UTC

    Use username-hist-yyyy-mm, you'll thank me next year

Re: Script to zip users cmd history log files
by choroba (Cardinal) on Feb 02, 2012 at 08:54 UTC
    In which aspect is your question related to Perl?
      Hi there, never mind. I wanted to do a Perl Script of the commands I provided but had some help doing it in Bash script so that pretty much did the job.
      #!/bin/bash OLD_HIST_DIR="/var/log/user_history/old_logs" HIST_DIR="/var/log/user_history" MNTH_DEST_DIR="/var/log/user_history/old_logs/$(date +'%m')" # date +'%m' gives number corresponding to the current month in 01,02, +...11,12 fashion mkdir -p "${MNTH_DEST_DIR}" "${OLD_HIST_DIR}" # This will create the +directory if not present cp -p ${HIST_DIR}/*history ${OLD_HIST_DIR} gzip -9 ${OLD_HIST_DIR}/*history mv ${OLD_HIST_DIR}/*.gz ${MNTH_DEST_DIR}
      @admins you may close this thread

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://951365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 06:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found