title: Should my script use cp or mv to be more robust?
body: <p>I have a bash script (Scientific Linux).
  The script has to operate on a file. Let's say "file.dat" (around 1 GB of size)
  After some time the scripts is restarted and executes the following:</p>
  
  <pre><code>if [ -f file.dat ];  then
      cp file.dat file.previous.dat
  fi
  </code></pre>
  
  <p>to have a backup of the file.
  Then a process starts and overwrites "file.dat"</p>
  
  <p>In order to be on the safest side (electricity shut down or anything unexpected). What would be the best option: cp or mv ?
  Thanks.</p>