title: Generate WAR file using shell script
body: <p>The plan is to generate WAR files from the various files used in webapp so that it is easier to backup and restore. I use crontab and a shell script that runs every week. The script first uses jar -cvf to generate WAR file to a new location, then rsync happens to a NAS. This is what it roughly looks like:</p>
  
  <pre><code>now=$(date +%Y%m%d)    
  jar -cvf /rsyncsource/$now.war /opt/webappfolder
  rsync -rsvp --log-file=log.txt /rsyncsource/ /nas/
  </code></pre>
  
  <p>I tried running the script and it worked as expected: create WAR file and rsync to NAS. However, when I add the script to crontab for automation, no WAR file is generated and only rsync happens. </p>
  
  <p>Would anyone care to enlighten a newbie? Thanks! </p>