LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-15-2013, 01:28 AM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 490

Rep: Reputation: 30
Backed up history command !


Dear Friends ,

I want to take history command backup using logrotate . In Linux , '/var/log' folder , logfiles are automatically backed up using logrotate .For example :
boot.log.1 , boot.log.2 .

Now I want , history command also backed up like : history.log.1 , history.log.2 .

Is it possible to do ?
 
Old 12-15-2013, 02:22 AM   #2
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 3,304
Blog Entries: 1

Rep: Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686Reputation: 686
History of what? ~/.bash_history? You can set your HISTFILESIZE var to have a really large number in .bashrc (default is 500 lines in debian according to the man page for bash).

If there's something I want to keep from .bash_history, I'll make a bash .sh script and copy it there. As a comment if I only want to reference it. Or I'll make periodic copies of my .bash_history with date and sometimes time stamps.

Alternatively if you have multiple interests and don't want bash_history flushing an interest out of your history, you can create multiple users and login as said users to have that other special interest .bash_history. You can use multiple users in the same X session. Just make sure the ~/.Xauthority file matches the contents of the user that launched the current X session. YMMV depending on distro.

Assuming that your HISTORY redundancy interest is bash_history and not something else. And that you don't want to lose your reference, versus having some sort of full accountability for all activity on a system.
 
Old 12-15-2013, 02:52 AM   #3
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 490

Original Poster
Rep: Reputation: 30
Thx a lot ....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
history command in hp ux abhijeetdutta Other *NIX 8 05-22-2014 03:10 PM
About history command linux_world Linux - General 2 02-17-2013 04:30 AM
History command loveulinux Linux - Newbie 8 11-14-2011 12:19 PM
[SOLVED] Is there any command to delete bash command history? cola Linux - Newbie 4 06-01-2010 08:32 AM
URGENT! Is there any command to get a history command lines and time in SUSE Linux.? igsoper Linux - Software 5 06-25-2009 03:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration