Portal Home > Knowledgebase > Articles Database > Backup/move all error_log to another directory


Backup/move all error_log to another directory




Posted by Razva, 08-29-2012, 01:45 PM
Hello, I would like to move all the "error_log" files to another backup directory. I'm doing this as none of my clients needs the error_logs any more, and I need to move all the files to another machine (so keeping the error_logs doesn't makes sense in this case). Example We have: /home/user1/public_html/error_log AND /home/user2/public_html/error_log The files should be moved to: /root/backup/errorlogs/user1/public_html/error_log AND /root/backup/errorlogs/user2/public_html/error_log I suppose that I need to play with find and xargs... Can somebody give me a hand with this? Thanks!

Posted by serve-you, 08-30-2012, 08:31 AM
You should be able to do this with a simple for loop. Something like this though my syntax may not be completely correct.

Posted by Razva, 08-30-2012, 08:33 AM
What do you think about this: 1) sync the files with 2) remove the synced files with Would this be better than the solution above? Thanks!

Posted by serve-you, 08-30-2012, 08:38 AM
Wait, are you trying to move live log files, or just the old rotated logs? If you are trying to move the live one's you should reconfigure apache with the new log location, stop it and move the logs, then restart apache with the logs in the new location taking care of permissions so it can still write there.

Posted by Razva, 08-30-2012, 09:00 AM
I'm trying to move all the logs, including live ones.

Posted by racknap1, 08-30-2012, 11:22 AM
Hi, I would not recommend your to move your running logs, your service bases on logs. Your service can be hampered. So it is best to let it be as it is.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
SemoWeb Orlando Down (Views: 639)