title: How to backup filesystem with tar using a bash script?
body: <p>I want to backup my ubuntu filesystem, and I wrote this little script. It is very basic, but being my first try I am afraid to do mistakes. And since it will take few hours to complete to see results, I think it is better to ask you as experienced programmers if I did something wrong.</p>
  
  <p>I'm particularly interested in <code>&gt;</code> will that record output of <code>mv</code> or will it output also results of <code>tar</code>?
  Also variables inside tar command is it correct way?</p>
  
  <pre><code>#!/bin/bash
  
  mybackupname="backup-fullsys-$(date +%Y-%m-%d).tar.gz"
  
  { time tar -cfpzv $mybackupname --exclude=/$mybackupname --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/dev / &amp;&amp; ls -gh $mybackupname &amp;&amp; mv -v $mybackupname backups/filesystem/ ; } &gt; backup-system.log
  
  exit
  </code></pre>
  
  <p>Anything I should know before I run this?</p>