Incremental backup as tar file

Disclaimer: Accessing the information on this page means you agree to the Sites Privacy Policy & Terms of Use Agreement.

If you have question that how to take tar backup by script then here is the solution.

In Linux tar backup is cool idea which make good sense as it allows to create differential archives backup on modified files.

here you go with script and save it as .sh extension file and run on linux system where you want to set backup.

The script is :

DATE=$(date +%Y%m%d)
TIME=$(date +%H%M)
tar –create –listed-incremental $LOG_FILE –gzip –verbose –file $TARGETFILEPATH $SOURCEDIR

Description :

This script you can set as per your requirement to execute. you can place it under /etc/cron.* path as per required.

DATE=$(date +%Y%m%d) : YYYYMMDD
TIME=$(date +%H%M) : HHMM

The file will be in form of “backup_YYYYMMDD.HHMM.tar.gz” and the log file is “backup_YYYYMMDD.snar“.

This article is contributed by RootLinuxBlog. If you like RootLinuxBlog and would like to contribute, you can submit an article using contact us from. See your article appearing on the RootLinuxBlog main page and help other Techies.
Please write comments if you found any error with the above article would really help us to serve you a better way. Thank you…

Linux Backup With Tar

Leave a Reply

Your email address will not be published. Required fields are marked *


Enjoy this blog? Please spread the word :)