How to get around tar'ing up files you don't have permissions?
I would like to tar up some system logs with core files as a normal user through a script. However these core files are owned by root.
Of course I get "cannot read directory ...: Permission denied" Is there a good way to grab these core files through a script? From searching around, I get that the best way is to modify the sudoers file, then run the script with sudo. Is this considered the safest and best way? Thanks! |
you do not
you become root , then tar them up the logs are owned by root you could set a cron job but "log rotate" should be doing that |
All times are GMT -5. The time now is 12:16 PM. |