Linux with Operating System Concepts



Download 5,65 Mb.
Pdf ko'rish
bet163/254
Sana22.07.2022
Hajmi5,65 Mb.
#840170
1   ...   159   160   161   162   163   164   165   166   ...   254
Bog'liq
Linux-with-Operating-System-Concepts-Fox-Richard-CRC-Press-2014

Option
Meaning
-A
Concatenate tar file(s) onto an existing tar file
-d
Use –diff to compare two archives
-r
Append files onto an existing tar file
-t
Output just the list of content (file names, directory names) of a tar file, not 
the content itself
-u
Append only files newer than the tar file; used for incremental backup; note 
that this only adds new files, it does not alter or add modified files
-j, -J, -z
Compress the tar file using bzip2, xz, gzip
-I 
file
Compress using the executable compression program 
file


432

Linux with Operating System Concepts
The 
cpio
program is newer than tar and can access either cpio or tar-based archives. 
Cpio runs in one of three modes: copy-in, copy-out, and copy-pass. The copy-in and copy-
out modes are similar to extraction and creation operations in tar, respectively. This may 
seem counterintuitive in that “in” usually denotes input into the program, but here “in” 
references movement of data with respect to the file system (from archive into file system) 
and “out” references movement out of the file system (from file system out to archive). The 
options for copy-in and copy-out mode are -i and -o, respectively. Keep in mind then that 
-i extracts from the archive while -o creates the archive.
The copy-pass mode is like using copy-out and copy-in combined and then discarding the 
archive. That is, copy-pass takes files from one location and copies them to another as if you 
were creating and then extracting from an archive but without retaining the archive itself.
Cpio in copy-out mode, unlike tar, is interactive. If using copy-out mode, you are placed 
at a prompt where you type in file names. The instruction for copy-out mode is
cpio –o –F 
filename
where 
filename
is the archive to create. As you type each file name, that file’s contents are 
copied into an archive.
A session to create or add to an archive might look like this.
$ cpio –o –F new_archive
file1.txt
file2.txt
file3.txt 
<
control
+
d
>
183 blocks
$
After typing control
+
d, the cpio program archives the files whose names were entered. 
These are placed into the new file new_archive. Once done, cpio responds with the archive’s 
size in blocks and returns you to your Bash prompt. If the archive already exists, it is over-
written. You can append to an existing archive by adding the option --
append
.
The copy-in mode can be used to either output stored content (restore the content) or 
output the names of the items in the archive. To extract the files from the archive, use
cpio –i –F 
archive
and to list the contents, use
cpio –i –F 
archive
–list
Another common backup tool is 
rsync
. This program, while capable of performing 
backups, is available as a network-based file copying tool. As such, it is similar to Linux 
programs rcp (remote copy) and scp (secure copy). The command that you would issue 
varies depending on whether you are doing a remote or local copy and in which direction. 
There are three possibilities:


The Linux File System

433
• 
rsync
source destination
—local copy
• 
rsync
username@host:source destination
—copy from remote to local 
computer
• 
rsync
source username@host:destination
—copy from local to remote 
computer

Download 5,65 Mb.

Do'stlaringiz bilan baham:
1   ...   159   160   161   162   163   164   165   166   ...   254




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish