Note that there are some explanatory texts on larger screens.

plurals
  1. POUbuntu root Cron job not completing
    text
    copied!<p>I'm running a combination backup script from a root cron on my Ubuntu 10.04 LTS Server.</p> <p>The root cron looks like this:</p> <pre><code># m h dom mon dow command 0 1 * * 2-6 /home/cbhiadmin/archive </code></pre> <p>It's executed as it's expected. The archive command kicks off several individual facility backups. The code is as follows:</p> <pre><code>#!/bin/bash # This script executes several individual facility archive processes &amp; logs success. /home/cbhiadmin/archive104 /home/cbhiadmin/archive106 if [ $? -ne 0 ]; then echo "$(date '+%m/%d/%y-%H:%M') Nightly Addon backup SUCCESSFUL" &gt;&gt; /home/cbhiadmin/addon_backups/addon_backup.log exit fi </code></pre> <p>Then the last part is an individual facility backup as follows:</p> <pre><code>#!/bin/bash # This script archives a facility, FTPs the archive to 10.5.2.76, &amp; logs failure. today=$(date '+%m%d%y') site="106" cd /home/cbhiadmin/addon_backups/"$site" if [ ! -f "$site"adata_"$today".tar.gz ]; then tar --exclude *.CSV --exclude *.csv -czf "$site"adata_"$today".tar.gz -C /usr/bbx/aon/ "$site"/ADATA/ if [ $? -ne 0 ];then echo "$(date '+%m/%d/%y-%H:%M') $site: Nightly Addon backup FAILED" &gt;&gt; /home/cbhiadmin/addon_backups/addon_backup.log fi fi cp "$site"adata_"$today".tar.gz /home/cbhiadmin/SAN/"$site" find ~/SAN/"$site"/*.tar.gz -maxdepth 1 -mtime +60 -exec rm {} + </code></pre> <p>My problem is that the last line does not seem to work from the root cron, but works when I run the archive as root myself. </p> <p>What's missing?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload