Cron [web_root] goes to /web not ~/web

Discussion in 'General' started by OITCONZ, Oct 8, 2024.

Tags:
  1. OITCONZ

    OITCONZ New Member

    I'm sure this is straight forward - probably something to do with jailed but if you dont ask ....

    Setting up cron for an accounting system (InvoiceNinja)
    if I use
    ``
    cd [web_root] && php8.3 artisan schedule:run >>/private/cron.log 2>>/private/cron_error.log
    ``
    I can see in /etc/cron.d/ispc_chrooted_web1 it is translated as /web
    /web doesnt exist. ~/web does.
    The same issue affects the logging. If I tick logging i get
    ``
    <cron line stuff here > >>/private/cron.log 2>>/private/cron_error.log
    ``

    /private doesnt exist but ~/private does
    As such I get errors
    ``
    log 2>>/private/cron_error.log #somedomain.example.com
    -bash: /private/cron.log: No such file or directory
    ``
    Is this to do with Jail? Jailkit chroot app sections

    Thanks for your reply.
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    If its a jailed cronjob, then /web exists in the jail. because what a jail does is that it changes / from / to /var/www/clients/clientX/webY/
    So when you as a SSH user (or a cronjob) is inside the jails and does a ls /, then you'll see that / is there.

    a cd [web_root] might not work for a jailed cronjob as the placeholder might contain the full path outside of the jail, try cd /web instead.

    When you are logged in as a jailed SSH user,/web is a symlink to /web for easier shell navigation. So ~/web is not a directory; it's just a symlink that points to the/web folder in the jail.
     

Share This Page