LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Commands to incremental backup with tar (https://www.linuxquestions.org/questions/linux-newbie-8/commands-to-incremental-backup-with-tar-904467/)

loveulinux 09-22-2011 12:33 PM

Commands to incremental backup with tar
 
Hi..all, I googled for shell script for incremental backup with tar and found it works fine. But I just want to check incremental backup using the commands manualy. As per man page I found -g/-G for incremental backup but I don't know how use those. First I ran
"tar -cjvf data.tar.bz2 data"
#ls -ltrh
total 3.3M
drwxr-xr-x 4 root root 4.0K 2011-09-22 21:17 data
-rw-r--r-- 1 root root 3.3M 2011-09-22 22:34 data.tar.bz2
#du -sh data
4.9M data
Then I added some files in data folder and ran
"tar -cjGvf data.tar.bz2 data"
found 0 for "echo $?", then I removed data directory and extracted using
"tar -xjvf data.tar.bz2" and found that the new files were exist in data folder.
Is this correct for incremental backup or the incremental should be happening with new files or in different than these two when we run it manually? If u r yes 2nd and 3rd, could u plz show the commands that how it should be?

mpapet 09-22-2011 02:03 PM

Rsyc greatly simplifies this task.

anishkumarv 09-22-2011 02:24 PM

use Rsync compare to tar its more reliable !!


All times are GMT -5. The time now is 05:33 PM.