title: one particular command in bash script doesn't work when run by cron, all other commands do
body: <p>I have a bash script that runs a few commands including rsync and this one below</p>
  
  <pre><code>rm -f $(ls -1t /nas/backups | tail -n +161)
  </code></pre>
  
  <p>If I execute the script myself on the cli, all commands work. However if run by cron all commands work except the one above. </p>
  
  <p>No idea why. The files in /nas/backups are owned by root, but cron is running as root. </p>
  
  <p>Any ideas? thanks</p>