Paste number 63363: Script to Reset OSRF Logs

Paste number 63363: Script to Reset OSRF Logs
Pasted by: gpal
When:11 months, 3 weeks ago
Share:Tweet this! | http://paste.lisp.org/+1CW3
Channel:#openils-evergreen
Paste contents:
Raw Source | XML | Display As
#!/bin/bash
# RESET OPENSRF LOGS------------------
clear
ls /openils/var/log > /tmp/001
vi /tmp/00.log -c wq
cat /tmp/001 | awk '{printf o="sudo cp /tmp/00.log /openils/var/log/" $0"\n"};' > /tmp/002
echo "#!/bin/bash" > /tmp/001
perl -e ' $count=0; while (<>) { if (! ($save{$_}++)) { print $_; $count++; } } ' /tmp/001 /tmp/002 > /tmp/00.sh
clear
echo "Clearing all OpenSRF logs"
chmod 755 /tmp/00.sh
sh /tmp/00.sh
sleep 1
echo "DONE"
sudo rm /tmp/001 /tmp/002 /tmp/00.sh

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.