I'm running a bash file to obtain data on what system processes are running (i.e netstat, syslog, arp etc). All's going well except for the history. I'm trying to save the history to a text file with
cp ~/. bash_history $path/filename.txt
Unfortunately this doesn't give me the complete history. If manually input the command
history > /media/root/usb/filename
I get a completely different result. My aim is to automate the whole process under the one bash file, is there a way of doing this. Also i'd ideally like the date and time with the history.