Difference between revisions of "Backup script sample"
Line 10: | Line 10: | ||
2 Shows message "packing files in progress..." on the screen<br/> | 2 Shows message "packing files in progress..." on the screen<br/> | ||
3 Packing file ''/root/install.log'' and folder ''/lib'' in archive named in format: '''root_lib-19.10-19-06-13.tar'''<br/> | 3 Packing file ''/root/install.log'' and folder ''/lib'' in archive named in format: '''root_lib-19.10-19-06-13.tar'''<br/> | ||
− | 4 Packing file of virtual machine ''/dev/vg-virt/kvm110_img'' which | + | 4 Packing file of virtual machine ''/dev/vg-virt/kvm110_img'' which is in use without suspending the VM. Archive name format: '''kvm110-19.10-19-06-13.gz''' |
"[[Category:Linux]]" | "[[Category:Linux]]" |
Revision as of 17:36, 19 June 2013
1#!/bin/bash 2echo "packing files in progress..." 3tar -cf /home/backup/root_lib-$(date +%H.%M-%d-%m-%y).tar /root/install.log /lib 4dd if=/dev/vg-virt/kvm110_img | gzip | dd of=/home/backup/kvm110-$(date +%H:%M-%d-%m-%y).gz bs=4096 5find /home/backup/ -type f -mtime +6 -exec rm {} \; 6echo "completed"
Strings:
1 Describes the language
2 Shows message "packing files in progress..." on the screen
3 Packing file /root/install.log and folder /lib in archive named in format: root_lib-19.10-19-06-13.tar
4 Packing file of virtual machine /dev/vg-virt/kvm110_img which is in use without suspending the VM. Archive name format: kvm110-19.10-19-06-13.gz
""