LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-18-2015, 09:43 PM   #1
superbbrr
LQ Newbie
 
Registered: May 2015
Posts: 3

Rep: Reputation: Disabled
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!
 
Old 05-18-2015, 09:49 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,830

Rep: Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409Reputation: 2409
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] command for tar'ing multiple sub-directories into a single tar file blainemiller Linux - Server 3 04-21-2011 03:05 PM
don't have permissions on files I want to delete drawde83 Ubuntu 2 07-13-2007 01:11 AM
[Ruby] Tar'ing or Zip'ing with ruby script lmcilwain Programming 2 01-19-2007 07:56 PM
need help with tar'ing and bz2'ing a file surfbass Linux - General 4 06-01-2005 06:07 PM
permissions on tar backup files durden2.0 Linux - Newbie 4 08-04-2004 12:50 AM


All times are GMT -5. The time now is 10:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration