mxgross / EasyBackupBundle

Kimai 2 Plugin for easier backups
MIT License
24 stars 6 forks source link

Permission Issue on dev branch when restoring backups (orig. created by biologghe) #35

Closed mxgross closed 3 years ago

mxgross commented 3 years ago

I created a issue for your test result @biologghe

FYI I did a restore attempt but bumped into this error: [2020-12-27 15:48:00] request.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/home/pi/kimai2/var/easy_backup/2020-12-27_151908/.env" to "/home/pi/kimai2/.env"." at /home/pi/kimai2/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\Component\Filesystem\Exception\IOException(code: 0): Cannot rename \"/home/pi/kimai2/var/easy_backup/2020-12-27_151908/.env\" to \"/home/pi/kimai2/.env\". at /home/pi/kimai2/vendor/symfony/filesystem/Filesystem.php:290)"} []

I had changed the permissions of .env to g+rw

So we can communicate here, I closed the other issue because it was another topic which was solved.

I did not get this overwrite/rename error, so I think my permissions are different. At least I should catch these errors, log them and inform the user about it.

Best regards, Max

mxgross commented 3 years ago

Hello @biologghe, please pull the dev branch and give it a new try. I implemented a automatically permission change when a file cannot be overwritten. I tested it in my windows dev env only by now. Please let me now how it works and append the 'Latest log' after the restore attempt.

Best regards, Max