Difference between revisions of "Backup script sample"

From vpsget wiki
Jump to: navigation, search
(Created page with " #!/bin/bash 1<pre echo "packing files in progress..."</pre> 2<pre>tar -cf /home/backup/root_lib-$(date +%H:%M-%d-%m-%y).tar /root/install.log /lib</pre> dd if=/dev/vg-virt/...")
 
Line 1: Line 1:
  
 
  #!/bin/bash
 
  #!/bin/bash
1<pre echo "packing files in progress..."</pre>
+
1echo "packing files in progress..."
2<pre>tar -cf /home/backup/root_lib-$(date +%H:%M-%d-%m-%y).tar /root/install.log /lib</pre>
+
2tar -cf /home/backup/root_lib-$(date +%H:%M-%d-%m-%y).tar /root/install.log /lib
 
  dd if=/dev/vg-virt/kvm110_img | gzip | dd of=/home/backup/kvm110-$(date +%H:%M-%d-%m-%y).gz bs=4096
 
  dd if=/dev/vg-virt/kvm110_img | gzip | dd of=/home/backup/kvm110-$(date +%H:%M-%d-%m-%y).gz bs=4096
 
  find /home/backup/ -type f -mtime +6 -exec rm {} \;
 
  find /home/backup/ -type f -mtime +6 -exec rm {} \;
 
  echo "completed"
 
  echo "completed"
 
Strings:
 
Strings:
1 Describes the language
+
<span style="color:#c0c0c0"> 1 </span>1 Describes the language
 
2 Shows message "packing files in progress..." on the screen
 
2 Shows message "packing files in progress..." on the screen
 
3  
 
3  
 
"[[Category:Linux]]"
 
"[[Category:Linux]]"

Revision as of 16:48, 19 June 2013

#!/bin/bash
1echo "packing files in progress..."
2tar -cf /home/backup/root_lib-$(date +%H:%M-%d-%m-%y).tar /root/install.log /lib
dd if=/dev/vg-virt/kvm110_img | gzip | dd of=/home/backup/kvm110-$(date +%H:%M-%d-%m-%y).gz bs=4096
find /home/backup/ -type f -mtime +6 -exec rm {} \;
echo "completed"

Strings: 1 1 Describes the language 2 Shows message "packing files in progress..." on the screen 3 ""