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'm backing up my whole system to an external hard drive using tar and for the most part it works like a charm. However, I'm having trouble extracting symbolic links from the tarball, they are restored as empty files without any permissions or original ownership:
$ ls -l /home/jim/mysymlink
lrwxrwxrwx 1 jim jim 22 2010-08-19 00:18 /home/jim/mysymlink -> /media/Maxtor/mysymlink
$ sudo tar cfpz /media/Maxtor/backup1.tgz --exclude=/media/Maxtor /
$ sudo tar xfpz /media/Maxtor/backup1.tgz home/jim/mysymlink
$ ls -l /home/jim/mysymlink
---------- 1 root root 0 2010-08-19 00:19 /home/jim/mysymlink
All other files can be extracted properly with correct ownership/permissions, it's only symbolic links I'm having the problem with. Any ideas?
If the target of the symbolic link is under the base directory being archived and is also archived, then the symbolic link will be restored correctly. Look at the tar info file and search for "symbolic".
@smoker - the exclusion was for my external hard disk when creating the archive, the symlinks are on my computer. They were included in the archive but it's when I try to extract them I'm having the problem.
@jschiwal - these requirements are all met and it's still not working properly
@colucix - I'm running Tar 1.22 on Ubuntu 10.10 (lucid)
If the symlinks were in the archive, then when you extracted the archive, presumably as root, it merely copied the archive contents over the existing symlinks. But the links in the archive were broken when you excluded /media/Maxtor - hence the current situation. Tar can follow symlinks if you tell it to, but you didn't and you excluded the destination anyway.
IMHO anyway ...
Have you tried testing with a symlink that points at a file that does get archived ?