Backup and Recovery


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 1  
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?

Last edited by hicksd8; 10-12-2019 at 04:40 PM..
# 2  
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:

Code:
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:

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

Check using:

Code:
man tar

that your tar implementation supports -T switch.

Last edited by hicksd8; 10-12-2019 at 07:36 PM..
# 3  
Quote:
Originally Posted by engineer2002
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?
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?
# 4  
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.

Last edited by hicksd8; 10-13-2019 at 01:11 PM..
# 5  
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.
# 6  
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.
# 7  
Quote:
Originally Posted by engineer2002
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. \.
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.


Moderator's Comments:
Mod Comment
Please Note:

When any user must do something in a illogical way, for example not using normal Linux backup processes to do a basic backup, it is homework.

When people work "on a real job" they do not need to do things in illogical ways. Only people doing assignments from school ask for these kinds of solutions.

Please do not code answers to these kind of "obvious homework assignments".

This is obviously a homework (instructor assigned) problem.

Thanks.
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #494
Difficulty: Easy
A block of code is a section of code that has been logically grouped together.
True or False?

6 More Discussions You Might Find Interesting

1. Red Hat

Redhat backup/recovery

Can you please let me know a clear step by step procedure link/doc for an effective full backup and recovery procedure for a Redhat server with 2.6.34.9-69.fc13.x86_64 ? Thanks in advance. I also have the same question for Ubuntu Enterprise 12.04 if you would ... thanks again (0 Replies)
Discussion started by: cmontr
0 Replies

2. Shell Programming and Scripting

rsync backup mode(--backup) Are there any options to remove backup folders on successful deployment?

Hi Everyone, we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment? Thanks in adv. (0 Replies)
Discussion started by: MVEERA
0 Replies

3. Shell Programming and Scripting

rsync backup and recovery options

Hi, Do we have any options in rsync to recover files from the backup? Please share your thoughts. Thanks in advance. (0 Replies)
Discussion started by: MVEERA
0 Replies

4. Linux

Q: Backup and recovery in major corporations?

Hey guys, I hope this is the right place to post. As i'm not too sure where this question would go. The question is: How is backup and recovery carried out in major corporations. Even if you are not in a major corporation an answer would be great. I'm doing some research as to how it's carried... (2 Replies)
Discussion started by: LibRid
2 Replies

5. AIX

TSM backup and recovery problem

When I use tsm command: archive -subdir=yes /dir1/ to backup file system: /dir1 After I delete the contents under /dir1 and recovery it from TSM backup, retrieve /dir1/ I found the link breaked. Such as: Before: ls -l lrwxrwxrwx 1 abc develop 8 Apr 28 16:04 bin... (1 Reply)
Discussion started by: rainbow_bean
1 Replies

6. UNIX for Dummies Questions & Answers

backup recovery

i have taken a backup using cpio command. Now i want to retrieve the contents. Replies appreciated. raguram (2 Replies)
Discussion started by: raguramtgr
2 Replies

Featured Tech Videos