dimanche 13 octobre 2019

Delete old versions of app inside app directory

In Laravel 5.8 app I use envoy to upload changes on the server(ubuntu 16) and I created user for connect with commands :

sudo useradd lardeployer
sudo usermod -a -G sudo lardeployer

It works ok, exclude part where I want to remove all old projects, excluding last 5. I run command with methods :

$sortedDirectories::'.print_r($sortedDirectories,true).'</pre>';
        $leave_last_dirs= 5;
        $index= 1;
        foreach ($sortedDirectories as $next_directory) {
            echo '<pre>$index::'.print_r($index,true).'</pre>';
            if ( $index < count($sortedDirectories) - $leave_last_dirs ) {
                echo '<pre>chmod SET AND DELETED $next_directory ::'.print_r($next_directory,true).'</pre>';

                $process = new Process(['chmod -R 777 ' . $next_directory]);
                $process->run();

                $process = new Process(['rm -R ' . $next_directory]);
                $process->run();
            }
            $index++;
        }

But in console I see a lot of messages like :

chmod:
[laravelserver]: changing permissions of '/var/www/html/Hostels2Deployed/release/20190623-064420/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190623-064420/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190623-064420/storage/framework/sessions/fkizWaUKI8Kn2zeGhD0AGw7yEcSpkIccRkwN8DTk': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190623-064420/storage/logs/logging_deb.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/views/60b1223e3e702f95a92a7025c325cdeb779f6ea0.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/views/ef500fafc30acaec5d56ab3848bf574dbfdbfcdf.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/ed'
[laravelserver]: : Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/ed/b2': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/cb': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/framework/sessions/yBqH00BlyNKwITDGmPbS8sIX1eilsm6FR3bYJbju': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/sql-tracing-.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/access.log': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/logging_deb.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/error.log': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-063248/storage/logs/laravel-2019-10-10.log': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/ed': Operation not permitted
[laravelserver]: chmod:
[laravelserver]: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/ed/b2': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9'
[laravelserver]: : Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/cb': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190830-140823/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/ed': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/ed/b2': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/cb': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20190924-183000/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/views/1974e76665576f11502d27ef004fe355049a2da5.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/views/fc6e0d52676a06cc2d57569428bd65c821010061.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/ed'
[laravelserver]: : Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/ed/b2': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/ed/b2/edb27d7a1ff744451db32d8463dca06185b22cb9': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/cb': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/cb/58': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/cache/data/cb/58/cb580d5a70f9f64d95e092e7779d3a748dafbf27': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/framework/sessions/zDSeTYbjYQlfyx6ZNfm4EMH5tZNqGc7vrBQLSv4t': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/logs/sql-tracing-.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191003-171927/storage/logs/logging_deb.txt': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-104305/storage/framework/views/ae27261e40e8c0320687ce8d8fcdcc660134ce97.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-104305/storage/framework/views/5e67134644d48253ab3dc1eb0a4376a653ce1ac6.php': Operation not permitted
[laravelserver]: chmod: changing permissions of '/var/www/html/Hostels2Deployed/release/20191010-104305/storage/framework/cache/data/ed'
[laravelserver]: : Operation not permitted

Any ideas why error and how it can be fixed ?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2OGsAHP
via IFTTT

Aucun commentaire:

Enregistrer un commentaire