Linux - NewbieThis 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!
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.
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I want to create a batch file that backs up my linux configuration. I know that to do this I need to backup the directories VAR, ROOT, ETC and HOME. Root obviously requires root privileges, but I want to be able to run the batch file without being logged in as root. So what I want is:
1) I'm logged in as myself and I want to backup VAR, ETC, HOME and ROOT directories to another local drive.
2) I run a shortcut to a batch file which will do the job.
3) When started, the program asks for the root password.
I'm hoping step 3 means that the batch program will have root privileges to be able to backup ROOT. Is my way of thinking correct?
If anyone can write a good example that I can use I would be most grateful.
Thanks for your help. Can I create a shortcut that does "su - -c /root/backup.sh" to save typing it. If its not called a shortcut in Linux I apologise - I guess I'm having a hard time shaking off the Micro$oft upbringing. Actually shortcuts are called links in Linux aren't they?
I have observed several backup scripts on the net and I intend to make my own tailored one in due course.
BTW I like the signature - fortunately even I know what that does and I don't intend to do it - just yet.
I would suggest writing your backup script, then running it as a cron job. Cron jobs may be run as root, and you can set it up to do a backup daily, weekly, or whatever, and just overwrite the old one. Check out man crond, or else I'm sure there is a cron howto at the LDP.
you can also make the shell script owned by root and then set the permissions to suid it. This allows a program to be started by anyone, but run as the user. If you do want to do this though, you have to remember that it can create security holes.