jump to navigation

Solusi Backup Linux [2] September 7, 2009

Posted by setijoagus in Linux.
Tags: ,
add a comment

B. Mengenal rdiff-backup

A remote incremental backup of all your files could be as easy as “rdiff-backup / host.net::/target-dir”

‘rdiff-backup backs up one directory to another, possibly over a network. The target directory ends up a copy of the source directory, but extra reverse diffs are stored in a special subdirectory of that target directory, so you can still recover files lost some time ago. The idea is to combine the best features of a mirror and an incremental backup. rdiff-backup also preserves subdirectories, hard links, dev files, permissions, uid/gid ownership, modification times, extended attributes, acls, and resource forks. Also, rdiff-backup can operate in a bandwidth efficient manner over a pipe, like rsync. Thus you can use rdiff-backup and ssh to securely back a hard drive up to a remote location, and only the differences will be transmitted. Finally, rdiff-backup is easy to use and settings have sensical defaults.’

mulai menggunakan
1. download [saya menggunakan centos 4.7]
ftp://fr.rpmfind.net/linux/dag/redhat/el4/en/i386/dag/RPMS/rdiff-backup-1.2.8-1.el4.rf.i386.rpm

2. install
[root@linux ~]# rpm -ivh rdiff-backup-1.2.8-1.el4.rf.i386.rpm
warning: rdiff-backup-1.2.8-1.el4.rf.i386.rpm: V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing… ########################################### [100%]
1:rdiff-backup ########################################### [100%]

3. perintah – perintah rdiff-backup
==========================================================
3a. untuk backup : /usr/bin/rdiff-backup [yang_dibackup] [lokasi_backup]
==========================================================
[root@linux s11]# ls -la /s11/foto_logistik/*.txt
-rw-r–r– 1 root foto_logistik 11 Sep 2 13:43 /s11/foto_logistik/test.txt
[root@linux s11]# /usr/bin/rdiff-backup /s11/ /backup/s11


==========================================================
3b. untuk list backup : /usr/bin/rdiff-backup -l [lokasi_backup]
==========================================================
[root@linux /]# /usr/bin/rdiff-backup -l /backup/s11/
Found 4 increments:
increments.2009-09-02T13:14:11+07:00.dir Wed Sep 2 13:14:11 2009
increments.2009-09-02T13:28:06+07:00.dir Wed Sep 2 13:28:06 2009
increments.2009-09-02T13:44:04+07:00.dir Wed Sep 2 13:44:04 2009
increments.2009-09-02T13:51:29+07:00.dir Wed Sep 2 13:51:29 2009
Current mirror: Wed Sep 2 14:30:02 2009


==========================================================
3c. untuk restore : /usr/bin/rdiff-backup -r now [lokasi_backup] [lokasi_restore]
==========================================================
[root@linux s11]# /usr/bin/rdiff-backup -r now /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test.txt
[root@linux s11]# /usr/bin/rdiff-backup -r now /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test2.txt
[root@linux s11]# ls -la /s11/foto_logistik/*.txt
-rw-r–r– 1 root foto_logistik 11 Sep 2 13:43 /s11/foto_logistik/test2.txt
-rw-r–r– 1 root foto_logistik 11 Sep 2 13:43 /s11/foto_logistik/test.txt


==========================================================
3d. untuk restore : /usr/bin/rdiff-backup -r [jam tertentu] [lokasi_backup] [lokasi_restore]
==========================================================
[root@linux /]# rdiff-backup -r 2009-09-02T13:44:04+07:00 /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test3.txt
[root@linux /]# rdiff-backup -r 2009-09-02T13:51:29+07:00 /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test4.txt
[root@linux /]# rdiff-backup -r now /backup/s11/foto_logistik/test.txt /s11/foto_logistik/test5.txt

==========================================================
3e. hapus archive
==========================================================
[root@linux s11]# /usr/bin/rdiff-backup –remove-older-than 3D /backup/s11

Solusi Backup Linux [1] September 7, 2009

Posted by setijoagus in Linux.
Tags: , ,
add a comment

A. Awal Mula
Dulu saya melakukan backup di linux menggunakan tar, dimana saya buatkan script seperti berikut :
=============================================================
script backup tar
=============================================================
# .bash_profile
cd /backup
b_name=`date +%w`
if [ "$b_name" = 1 -o "$b_name" = 4 ]
then
tar cvzf /backup/ac/01snkm_acumum.tgz /s03/ac/umum -X no_file > logac_umum.txt
elif [ "$b_name" = 2 -o "$b_name" = 5 ]
then
tar cvzf /backup/ac/02sljm_acumum.tgz /s03/ac/umum -X no_file > logac_umum.txt
elif [ "$b_name" = 3 -o "$b_name" = 6 ]
then
tar cvzf /backup/ac/03rbst_acumum.tgz /s03/ac/umum -X no_file > logac_umum.txt
elif [ "$b_name" = 0 ]
then
tar cvzf /backup/ac/04mg_acumum.tgz /s03/ac/umum -X no_file > logac_umum.txt
fi

artinya dalam 1 minggu saya memiliki file :
/backup/ac/01snkm_acumum.tgz
/backup/ac/02sljm_acumum.tgz
/backup/ac/03rbst_acumum.tgz
/backup/ac/04mg_acumum.tgz

1. Cara ini sudah lama saya gunakan dan saya nyaman, untuk restore dengan menggunakan ‘mc’, saya bisa pilih file yang hanya akan direstore.
2. Sejalan dengan waktu hasil ‘tar’ menjadi semakin besar cara restore dengan menggunakan ‘mc’, menjadi tidak bisa, terpaksa dech ……..
3. Menggunakan cara ‘tar xvf’, kemudian baru direstore file yang rusak/diinginkan/hilang
4. waktu terus berlalu, file hasil ‘tar’ semakin membesar, pada saat ,menjalankan ‘tar xvf’, timbul error
tar: This does not look like a tar archive
tar: Skipping to next header
tar: Archive contains obsolescent base-64 headers
5. Tapi hal ini masih dapat diatasi dengan menggunakan ‘gzip -d’ baru kemudian ‘tar -xvf’ “thank’s to Jesus”
6. 3 bulan terakhir ada Komplain, pada saat schedulle backup berjalan [8 malam s/d 5 pagi], akses jadi lambat, bahkan backup masih berjalan sampai dengan jam 8 pagi baru selesai [serasa nggak ada jalan keluar]