1
00:00:00,000 --> 00:00:01,800
In this example, we're going to quickly walk through

2
00:00:01,800 --> 00:00:04,230
how to store files into our backup system.

3
00:00:04,230 --> 00:00:06,420
But first we're going to use the tar command,

4
00:00:06,420 --> 00:00:08,189
which stands for the tape archive command.

5
00:00:08,189 --> 00:00:10,890
So this can combine multiple files to make it efficient

6
00:00:10,890 --> 00:00:14,310
for when we store files together in the backup.

7
00:00:14,310 --> 00:00:15,600
Okay, before we start,

8
00:00:15,600 --> 00:00:18,030
just note your backup might be locked.

9
00:00:18,030 --> 00:00:19,620
So in order to unlock it,

10
00:00:19,620 --> 00:00:21,930
all you would do is go to your files application,

11
00:00:21,930 --> 00:00:24,630
locate that backup drive and enter your password.

12
00:00:24,630 --> 00:00:26,010
And that'll make things easier for one,

13
00:00:26,010 --> 00:00:27,780
you get on the command line.

14
00:00:27,780 --> 00:00:31,470
Okay, so we're going to use an example of employee data

15
00:00:31,470 --> 00:00:35,610
and we want to tar this up and put in our backup location,

16
00:00:35,610 --> 00:00:37,110
where it's encrypted and safe.

17
00:00:38,040 --> 00:00:39,930
So if we list out here,

18
00:00:39,930 --> 00:00:42,273
I have this employee info folder.

19
00:00:43,620 --> 00:00:45,720
And we're going to use the tar,

20
00:00:45,720 --> 00:00:47,730
create verbose file.

21
00:00:47,730 --> 00:00:48,563
Then we just want to indicate the file

22
00:00:48,563 --> 00:00:50,550
to what we want to name it as.

23
00:00:50,550 --> 00:00:53,373
Employee underscore data,

24
00:00:55,740 --> 00:00:56,573
tar,

25
00:00:59,580 --> 00:01:01,170
employee info.

26
00:01:01,170 --> 00:01:02,460
And this exclamation point is going to say,

27
00:01:02,460 --> 00:01:06,030
we're going to take every file that's in that directory

28
00:01:06,030 --> 00:01:07,280
and apply it to this tar.

29
00:01:08,250 --> 00:01:09,083
Okay?

30
00:01:10,380 --> 00:01:11,430
Now we're going to list out our drive

31
00:01:11,430 --> 00:01:13,593
just to see if that tar is present.

32
00:01:14,490 --> 00:01:17,523
Okay, we see employee data dot tar was successfully created.

33
00:01:18,420 --> 00:01:21,240
It's highlighted in the red, about six down.

34
00:01:21,240 --> 00:01:22,920
Now, we can use the tar command as well

35
00:01:22,920 --> 00:01:25,290
to list out the contents of that tar file.

36
00:01:25,290 --> 00:01:28,083
So we'll use that for the employee data dot tar file,

37
00:01:29,130 --> 00:01:30,464
but again, we just need a quick reference

38
00:01:30,464 --> 00:01:32,400
of the information that's in tar file.

39
00:01:32,400 --> 00:01:34,470
We want to use the tar dash T

40
00:01:34,470 --> 00:01:36,633
and the F option to specify that tar.

41
00:01:38,160 --> 00:01:38,993
Next thing we're going to do is go ahead

42
00:01:38,993 --> 00:01:43,323
and put that copy into that backup drive.

43
00:01:52,190 --> 00:01:53,023
Okay.

44
00:01:58,020 --> 00:02:00,390
Now again, let's just verify like always

45
00:02:00,390 --> 00:02:02,840
that it successfully made it to the backup drive.

46
00:02:04,440 --> 00:02:06,143
Alright, we see it there at the top.

47
00:02:08,520 --> 00:02:10,139
So next we're going to restore all the files

48
00:02:10,139 --> 00:02:13,200
from the archive and then restore a single file.

49
00:02:13,200 --> 00:02:14,900
So, let's go to that backup drive.

50
00:02:18,240 --> 00:02:19,073
K.

51
00:02:21,420 --> 00:02:23,733
Let's go ahead, extract this.

52
00:02:28,200 --> 00:02:29,283
Let's look and see.

53
00:02:30,305 --> 00:02:32,340
Now that employee info.

54
00:02:32,340 --> 00:02:34,440
That's there because we just extracted it.

55
00:02:36,510 --> 00:02:38,430
So now the directory is there,

56
00:02:38,430 --> 00:02:40,620
as if it was a normal directory.

57
00:02:40,620 --> 00:02:42,810
That's just going to list out this employee folder,

58
00:02:42,810 --> 00:02:44,640
just to make sure everything's in there.

59
00:02:44,640 --> 00:02:46,143
That's intended, alright?

60
00:02:47,160 --> 00:02:49,920
We see we have all the three files that we had earlier.

61
00:02:49,920 --> 00:02:52,070
Just go ahead and remove that really quick.

62
00:02:53,430 --> 00:02:54,263
We don't really need it.

63
00:02:54,263 --> 00:02:56,553
We're just using it for testing purposes.

64
00:02:59,010 --> 00:03:02,010
Alright, so we're just going to go ahead and un-tar,

65
00:03:02,010 --> 00:03:04,320
just one file specifically, just to test that out.

66
00:03:04,320 --> 00:03:06,100
we're going to use the XF option

67
00:03:10,020 --> 00:03:11,080
when it's employee

68
00:03:13,470 --> 00:03:15,240
info. So we have to specify the directory

69
00:03:15,240 --> 00:03:17,943
and the file that's within that archive.

70
00:03:21,900 --> 00:03:23,280
Alright. So if we look at here

71
00:03:23,280 --> 00:03:25,620
we see only that one file was removed.

72
00:03:25,620 --> 00:03:29,280
So once we see the, into the, we list out the contents

73
00:03:29,280 --> 00:03:31,800
of this employee directory,

74
00:03:31,800 --> 00:03:33,200
we should only see that one.

75
00:03:34,170 --> 00:03:35,070
Okay.

76
00:03:35,070 --> 00:03:36,300
The last thing we're going to do

77
00:03:36,300 --> 00:03:38,250
we want to learn how to sync data.

78
00:03:38,250 --> 00:03:39,660
So a lot of times what's going to happen

79
00:03:39,660 --> 00:03:42,030
in the organization is you want to have some information

80
00:03:42,030 --> 00:03:44,220
always copy to the backup.

81
00:03:44,220 --> 00:03:45,053
So the downside

82
00:03:45,053 --> 00:03:47,730
of using the tar file is typically it is not efficient

83
00:03:47,730 --> 00:03:50,730
at copying information from one location

84
00:03:50,730 --> 00:03:53,280
to the other that needs to be constantly updated.

85
00:03:53,280 --> 00:03:54,724
So what we're going to do is use the rsync

86
00:03:54,724 --> 00:03:58,170
and we're going to use a live file in our home directory.

87
00:03:58,170 --> 00:04:00,870
And we want to make sure anytime there's a change to any one

88
00:04:00,870 --> 00:04:04,470
of the files, only that information is being sent over

89
00:04:04,470 --> 00:04:06,750
to the backup drive because we don't want to have to

90
00:04:06,750 --> 00:04:09,000
copy full drives over and over again,

91
00:04:09,000 --> 00:04:10,830
cause that takes up network bandwidth.

92
00:04:10,830 --> 00:04:13,740
And rsync is the perfect command to use with because

93
00:04:13,740 --> 00:04:16,829
of its efficiency in synchronizing data.

94
00:04:16,829 --> 00:04:19,130
So I have a sense of data photo listed in here

95
00:04:20,070 --> 00:04:22,410
and we're going to use that as the test.

96
00:04:22,410 --> 00:04:25,020
So we're going to make sure that any time that any

97
00:04:25,020 --> 00:04:26,790
of the contents of sensitive data,

98
00:04:26,790 --> 00:04:28,490
which we can list out really quick

99
00:04:30,690 --> 00:04:33,660
are changed on the backup side.

100
00:04:33,660 --> 00:04:34,860
Only what's changed.

101
00:04:34,860 --> 00:04:37,590
That file is going to be sent over for the update.

102
00:04:37,590 --> 00:04:39,600
Again, reducing that network bandwidth

103
00:04:39,600 --> 00:04:41,490
and increasing efficiency.

104
00:04:41,490 --> 00:04:43,840
First thing we need to do is do a rsync command

105
00:04:45,180 --> 00:04:47,640
use archive for our verbose mode,

106
00:04:47,640 --> 00:04:49,240
We going to use our sensitive data,

107
00:04:50,340 --> 00:04:52,353
Do the backup data.

108
00:04:53,310 --> 00:04:55,563
Okay. Send all three files.

109
00:04:56,940 --> 00:05:00,750
We see how many devices sent, how many received, speed.

110
00:05:00,750 --> 00:05:04,683
Again, this tool is designed for network efficiency.

111
00:05:07,290 --> 00:05:09,360
Alright. So next let's add some data

112
00:05:09,360 --> 00:05:11,160
to one of our software listing folders.

113
00:05:11,160 --> 00:05:14,133
So I'm just going to put, let's say new data to be added.

114
00:05:18,180 --> 00:05:19,013
Okay.

115
00:05:20,490 --> 00:05:21,323
Going to pin this

116
00:05:25,707 --> 00:05:27,040
new software listing

117
00:05:28,410 --> 00:05:29,913
new one dot TXT.

118
00:05:30,780 --> 00:05:32,430
I'm going to use rsync command.

119
00:05:32,430 --> 00:05:33,960
You're going to see is only going to send the data that

120
00:05:33,960 --> 00:05:34,793
was updated

121
00:05:35,760 --> 00:05:36,593
Again AV.

122
00:05:45,240 --> 00:05:46,073
Alright.

123
00:05:46,073 --> 00:05:48,840
So we see it only sent the software listing one

124
00:05:48,840 --> 00:05:50,790
because the other ones were not updated.

125
00:05:50,790 --> 00:05:54,300
So again, it shows that it increases efficiency by lowering

126
00:05:54,300 --> 00:05:56,340
the amount of traffic that is added to the network

127
00:05:56,340 --> 00:05:57,870
for backups.

128
00:05:57,870 --> 00:05:58,740
Alright, quick overview.

129
00:05:58,740 --> 00:06:02,190
We went through how to tar up files, how to extract them

130
00:06:02,190 --> 00:06:05,850
and how to sync the information typically to data backup

131
00:06:05,850 --> 00:06:08,190
for a maximum efficiency using the rsync command

132
00:06:08,190 --> 00:06:09,150
that concludes this walkthrough.

133
00:06:09,150 --> 00:06:10,950
And I'll see you in the next lesson.

