Backup and Recovery

Is it possible to take incremental backup in Linux using tar command?
Please guide me.

Suppose I have a directory /data.
And want incremental backup.
What will be the incremental "tar" command syntax?

Are you going to script this operation?

There are many many ways to do it. No doubt you will get other suggestions.

One way is to create a timestamp file when the full backup is run by adding:

date>/tmp/timestamp

to the beginning of your full backup script.

(Note: Although the content of timestamp will contain date/time information it is only the inode content that matters here.)

Then, when you want to take an incremental backup you find all files newer (modified after) than that timestamp and backup that list with the "-T" switch:

find /data -newer /tmp/timestamp  | tar -cvf <incremental archive name> -T -

Check using:

man tar

that your tar implementation supports -T switch.

Linux already has many good backup systems which uses some variations of tar (or rsync and tar ) and is executed from cron .

Why not use that one of those and not reinvent the wheel?

Would you like to share your WhatsApp number, if you don't mind. For better understanding.
Dear neo, I am newbie of Linux, kindly guide me from scratch, if possible.

From full backup to cron job.

Regards,
Rashid Hussain.
Thanks for your precious reply.

It really doesn't matter that you are a "newbie". Forum rules state that technical discussions are kept on the forum and not off-line. Feel free to ask whatever you like, it will help future readers with the same problem.

The point about your question is this. If you want to do any incremental backup then you must have put down a timestamp on a full backup to know what your increment is. Yes, you can use a backup package to do that which will store such a timestamp under the radar automatically, or you can do it yourself (as I described in my post above) where you can see that timestamp.

Please place your further questions on this thread.

Could you please guide me where I can find this procedure from the scratch.

I will be very thankful, I have to do because of as assignment. Kindly, please help me.
I have read somewhere it is the combination of two 02 commands
Tar and mtime.

I am getting confus.

Regards.
Rashid Hussain.

Do not post classroom or homework problems in the main forums. Homework and Questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.