Linux / UNIX Tech Support Forum
This is a discussion on How to archive files along with folders using TAR? within the Shell scripting forums, part of the Development/Scripting category; Is that script right? DIRS="/home/folder1 /home/file1.php /home/file2.php" BACKUP=/tmp/backup.$$ FILE="fs-full-$NOW.tar.gz" tar -zcvf $BACKUP/$FILE $DIRS I have to type the /home for ...
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Is that script right?
DIRS="/home/folder1 /home/file1.php /home/file2.php" BACKUP=/tmp/backup.$$ FILE="fs-full-$NOW.tar.gz" tar -zcvf $BACKUP/$FILE $DIRS I have to type the /home for each file? Does it keep the folder structure when extracting? In my example it should be after extracted: /home/folder1 /home/file1.php /home/file2.php Thanks a lot. |
| Sponsored Links | ||
|
|
|
||||
|
Yup it keep the structure after extracting
__________________
Vivek Gite Linux Evangelist |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Shell script to restructure folders recursively | kalt | Shell scripting | 2 | 26-10-2007 12:47 AM |
| Shell script for automatic conversion of files in tar files | kasimani | Shell scripting | 2 | 08-02-2007 03:45 PM |
| Public Folders In Scalix | zafar466 | Mail Servers | 0 | 08-02-2007 12:52 PM |
| auto deleting folders if empty | hinix | Shell scripting | 3 | 08-09-2005 05:02 PM |