skip to Main Content

i’m trying to set a cronjob on plesk panel to remove folders in a directory /uploads/temp_files.
I’m using this command:
find /uploads/temp_files/* -type d -ctime +30 -exec rm -rf {} ;
but i get an error from plesk: -: find: command not found

what can i do?
Thanks!

2

Answers


  1. You should use the full path. Instead of find use /bin/find. Depending of your linux distro, the location might be differnt. On a ssh shell console use this:

    which find
    

    The output will show you the exact location of find. Then use that full path in your cron job!

    Login or Signup to reply.
  2. Because of security reasons hosting providers use chrooted shell.
    In case your subscription has chrooted shell you have limited access to server commands and there is no find binary in Plesk default chrooted shell.

    You can check it by following path “/var/www/vhosts/example.com/bin/” in “File Manager”:

    Plesk chroot bash

    In this case you may ask your hosting provider to add find in your subscription or in common chroot template by following KB: https://support.plesk.com/hc/en-us/articles/213909545–HOWTO-How-to-add-new-programs-to-a-chrooted-shell-environment-template

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search