| Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
04-19-2012, 05:20 AM
|
#1
|
|
Member
Registered: Apr 2004
Location: Baltimore, MD
Posts: 681
Rep: 
|
sudo regex
I would like to give sudo access to a user to tar gzip a website. The only issue is the destination directory where the file should be gzipped is not fixed and also the gzip file name also need to be appended with YYYYMMDD. Is there any way to do this?
Thanks.
|
|
|
|
04-19-2012, 05:30 AM
|
#2
|
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 42,676
|
not with sudo, I'd suggest looking at writing a script to work this stuff out, and let them run the script from sudo.
|
|
|
|
04-19-2012, 02:19 PM
|
#3
|
|
Member
Registered: Apr 2010
Location: USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix
Posts: 731
Rep: 
|
Well actually ...
1. The date thing is easy and can be done on a command-line - that part does not require a script.
2. The floating target is more of an issue, it would be best to pin down the target directory so it does not change.
You might give them sudo permissions to run a script (and nothing else) but that is only secure if the script cannot change. Placing it on a read-only partition (cd perhaps) might be wise. Restrict the file name to something hard-coded in, but let it request the folder location from the user.
Make sure that your script evaluates the input to ensure that the folder exists, it does not overwrite an existing file, and that the user is not making a typo that could get someone fired.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 06:19 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|