Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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 would like to prepare an archive of directories used in common by many users, including root on a server.
The archive should be prepared by crontab and zip, if possible (I used these for the backup of the user's home directories).
My questions are:
- does this archive have to be prepared by su? (I suppose even root could not read all files there)
- if so, how can I prepare the superuser's crontab? (I already know how to prepare the user's crontabs). How can I ensure that a shell have su rights?
- when su extracts files from such an archive, will the extracted files be owned by su (or root) or by the users who originally owned them? (the latter is a must)
- is it possible to keep the original access rights even when the files are in the archive, i.e.:
- each user should be enabled to extract his own files from the archive, and
- no user should be allowed to extract or read the files of other users for which he did not have at least read access rights originally?
So, is it possible to prepare such an archiving system?
It is the second day that I examine this question and I begin to suspect that zip will not retain permissions, so I have to use tar + gzip.
Yet, after reading the tar and gzip manuals and info pages several times I was not able to successfully compress just one single file into tar.gz (except for those that I did not intend to).
Could anyone please tell me what command can I use to pack one directory and its subdirectories into a single, specific tar.gz file?
Moreover: (if I succeed) I will possibly have a huge archive containing thousands of files. Is it possible to update a tar.gz file with files that have changed, or the entire archive has to be re-created? This makes a great difference, since, if the archives of all users have to be recreated just because of one or two files that have changed, the whole weekend will not be enough for the work and the server will be heavily loaded.
Thank you in advance for your help.
Note: If the archive will span GB, you may need to split the output.
tar -cz /home | split (split otions that I"m too lazy to lookup at the moment)..
This would create a series of files split at a certain size. To restore from such a beast:
cat files | tar -xz
You would not be able to use the -u update option that way (I don't think).
Also note, the -u will append any new files at the end of the archive, but does not remove the old file. This does not cause problems to restore, but the archive file will continually grow in size as each update to files gets appended.
And finally, to clarify. Tar is used to pack multiple files into a single file. gzip (or bzip2) is used to compress a file. If what you want to do is compress a single file, the command is simply gzip filename