Singapore Flyer

Tuesday, January 20, 2015

tar: Removing leading `/' from member names

When I write a script to tar a folder, I am getting the following error

tar: Removing leading `/’ from member names

Here is the script line /bin/tar czf “/data1/backups/$DATE/html_$DATE.tar.gz” /var/www/html/

Solution: Use the option P, will solve this error

New Code : /bin/tar czPf “/data1/backups/$DATE/html_$DATE.tar.gz” /var/www/html/

No comments:

Post a Comment