• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Cron in virtual server with Plesk 12.5 can't find the find command

IATechsupport

Basic Pleskian
I'm trying to setup a simple cron job from Plesk GUI to delete the contents of a dir every day.

with:

find /var/www/vhosts/domain.name/httpdocs/var/session -name 'sess*' -type f -print -delete

when I run it all I get is " find command not found"
 
Hi IATechsupport,
try using the full path to find...


Code:
/usr/bin/find /var/www/vhosts/domain.name/httpdocs/var/session -name 'sess*' -type f -print -delete

Regards

Lloyd
 
Where are you running the command from? Under the domain, or in...

Tools & Setting > Scheduled Tasks

Regards

Lloyd

EDIT: If under the domain try like...

/usr/bin/find /httpdocs/var/session -name 'sess*' -type f -print -delete
or
find /httpdocs/var/session -name 'sess*' -type f -print -delete

Should work too.
 
Last edited:
we also get this error when we logout of Plesk client control panel,

ERROR: PleskFatalException
Original link and target URL should be on the same domain.

Not sure if it's related in some way

regards
Alan
 
I had the same issue. Solution of KB #115889 works great. Thanks!

But you should be aware of that users may be able to do things in the global environment. This could be a security issue.

It might be better to add the application to the chroot environment: https://kb.plesk.com/de/115842
 
Thanks for that info, I want to try and add "Find" to the chrooted environment, but my attempts such as this ./chroot_update.sh --add '/usr/bin/find' come back with a warning
find is not a program file.

How then do I add it ?

Thanks
 
Install find...

Debian
# apt-get install findutils

CentOS
# yum install findutils

If I remember correctly.
Regards

Lloyd
 
Hi IATechsupport,

when "findutils" are installe, you might use:

./chroot_update.sh --add `which find`

or​

/FULL/PATH/TO/chroot_update.sh --add `which find`
 
I tried: ./root/chroot_update.sh --add 'which find'

and the response was:

./root/chroot_update.sh: line 240: [: which: binary operator expected
WARNING: which is not a program (filetype cannot open `which' (No such file or directory)). Skipping.
 
Back
Top