- First, select a directory whose backup you want to take. We will use the tar command. Let's assume that you want to take backup of your /work directory:
$ tar cvfz work.tar.gz /work
- Now, we will write a script to take an incremental backup. Create a incr_backup.sh script and write the following code in it:
#!/bin/bashgunzip /work/tar.gztar uvf /work.tar /work/gzip /work.tar