I have an Apache Tomcat running on CentOS7 server which had a file catalina.out of around 157MB in size. I was trying to download that file on my local system so I ran the tar -czf command but I accidentally ran the command in reverse direction:

tar -czf $CATALINA_HOME/logs/catalina.out catalina.out.gz

Which emptied the entire log file. I tried to restore the file but couldn't get success.

I saw the swap file so tried to restore the content like:

vim -r $CATALINA_HOME/logs/catalina.out

But this didn't work. Is there a way I can rollback the logs?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.