ispCP - Board - Support
/bin/sh: root: command not found - Printable Version

+- ispCP - Board - Support (http://www.isp-control.net/forum)
+-- Forum: ispCP Omega Support Area (/forum-30.html)
+--- Forum: System Setup & Installation (/forum-32.html)
+--- Thread: /bin/sh: root: command not found (/thread-1879.html)



/bin/sh: root: command not found - grungy - 11-27-2007 09:31 PM

I am getting following mails from the Cron daemon:

Code:
Cron <root@ns3> root find /etc/ispcp/*/backup/* -maxdepth 0 -type f -mtime +7 -print | egrep '.*\.[0-9]+$' | xargs /bin/rm


/bin/sh: root: command not found
/bin/rm: missing operand
Try `/bin/rm --help' for more information.

I am using trunk-20071125


RE: /bin/sh: root: command not found - joximu - 11-27-2007 09:45 PM

Hi grungy

could you post the line in /etc/cron.d/ispcp which matches the line above?
Should look like this

@daily root find /etc/ispcp/*/backup/* -maxdepth 0 -type f -mtime +7 -print | egrep '.*\.[0-9]+$' | xargs -r /bin/rm

the "-r" after xargs was added later - it prevents the second error message (rm: missing operand)

what OS do you use?

/J


RE: /bin/sh: root: command not found - grungy - 11-27-2007 09:48 PM

Code:
# Backup
@daily root /var/www/ispcp/engine/backup/ispcp-backup-all yes &>/var/log/ispcp/ispcp-backup-all-mngr.log
@daily root /var/www/ispcp/engine/backup/ispcp-backup-ispcp noreport &>/var/log/ispcp/ispcp-backup-all-mngr.log

# Remove config backups older than seven days
@daily root find /etc/ispcp/*/backup/* -maxdepth 0 -type f -mtime +7 -print | egrep '.*\.[0-9]+$' | xargs -r /bin/rm

# Remove Daemon Logs older than 14 days (except .gz files)
@daily root find /var/log/ispcp/* -maxdepth 1 -type f -mtime +14 -print | egrep '.*\.gz$' | xargs -r /bin/rm

Code:
cat /etc/debian_version
4.0



RE: /bin/sh: root: command not found - joximu - 11-27-2007 09:56 PM

hm - looks fine.

and debian etch should know the interval "@daily" so I don't know why you got this error...

you could copy the line and set a fix time in front:
Code:
0 13 * * * root find /etc/ispcp/*/backup/* -maxdepth 0 -type f -mtime +7 -print | egrep '.*\.[0-9]+$' | xargs -r /bin/rm

to run the cronjob at 13 o'clock...
and then look in the log...

/J