• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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