Friday, October 9, 2009

backup with tape

See tldp or ubuntuforums

Backup using tar:
tar -zcvpf /archive/full-backup-`date '+%d-%B-%Y'`.tar.gz --directory / --exclude=mnt --exclude=proc --exclude=var/spool/squid .

Restore:
tar xvpfz full-backup-date-XXX.tar.gz -C /

Rewind of tape (before all operations):
mt -f /dev/st0 rewind

List of files (tar.gziped archive) on tape:
tar -tzf /dev/st0

Extracting of directory www from archive to actual directory:
tar -xzf /dev/nst0 www

Tuesday, October 6, 2009

archiving

See redhat

Tar gzip folder:
tar czvf folder.tar.gz folder/
Un-tar zip folder:
tar -xvf folder.tar.gz
Un-tar file from gzip :
tar -xvf folder.tar.gz path/in/archive/file
List of tar.gz file :
tar -tvf folder.tar.gz


Arj folder:
arj ac folder.arj folder/
Un-arj folder:
arj e folder.arj

Zip folder:
zip -r folder.zip folder/
Un-zip folder:
unzip folder.zip

Friday, October 2, 2009

quota

See redhat or linuxhelp

Install quota:
aptitude install quota quotatool

Add usrquota,grpquota to your /etc/fstab for some volume, eg.
/home /home ext3 defaults,usrquota,grpquota 1 2

Remount your volume
mount -o remount /home

Check quota
quotacheck -vagu

Turn quota on
quotaon -vagum

Set grace period
edquota -t

Modify user quota
edquota -u user

or by (200M is soft, 250 is hard limit for user new in /home):
quotatool -u new -bq 200M -l '250 Mb' /home

Copy user quota from old to new user
edquota -p old new

List of quotas on volume
repquota /home

List of all quotas
repquota -a