Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/tmp-folder is being filled #50

Closed
skovmand opened this issue Nov 4, 2015 · 10 comments
Closed

/tmp-folder is being filled #50

skovmand opened this issue Nov 4, 2015 · 10 comments

Comments

@skovmand
Copy link

skovmand commented Nov 4, 2015

Hi!

First of all thanks for your package. It's a great help for me.

My system dumps its database every hour and uploads to S3. It seems the package uses the /tmp folder for temporary files, but doesn't remove them afterwards. This means my drive is slowly filling up with files, eventually eating up all disk space (my db is about 200MB in size).

Can you comment on this? Perhaps the problem lies elsewhere.
I know I can just make a cron job to delete the files, but I thought the problem might exist for others too.

My server setup is a Laravel Forge server (Ubuntu Linux 14.04, 40GB disk on DigitalOcean Amsterdam).

@freekmurze
Copy link
Member

Normally the /tmp folder is managed by the OS. But because other uses were reporting the same problems I've made a change so the package will explicitly remove it's temp files.

Did you install v2.8.0?

@joedawson
Copy link

Hello,

I'm also having this same issue. I've used this package for about 6 months and I have to (regularly) empty my /tmp folder myself as my disk space fills up very quickly - I only have 8GB on my AWS server as most of my resources are stored on S3. Usually have to empty /tmp every couple of days.

I upgraded to 2.8.0 and still have the same issue. Here's what I'm seeing.

forge@joe-aws:/tmp$ ls -la
total 44
drwxrwxrwt  2 root root 36864 Nov 21 10:10 .
drwxr-xr-x 23 root root  4096 Nov 11 06:50 ..

Emptied my /tmp folder.

forge@joe-aws:/tmp$ cd ~/mydomain.com/
forge@joe-aws:~/mydomain.com$ php artisan backup:run
Start backing up
Database dumped
Determining which files should be backed up...
Start zipping 1095 files...
Zip created!
Start uploading backup to s3-filesystem...
Backup stored on s3-filesystem in file "backups/20151121101044.zip"
Backup successfully completed

Excellent! Backup is done.

forge@joe-aws:~/mydomain.com$ cd /tmp/
forge@joe-aws:/tmp$ ls
laravel-backup-dbiPCv4s  laravel-backup-dbrBWLC8

I go back into /tmp, backups 😢

As @skovmand mentioned - I guess I could just set up a cron to delete it, but seeing as you mentioned it should delete the temporary file(s) now, I'm not so sure it's working.

@freekmurze
Copy link
Member

Thanks for your efforts testing this. I'll take a look at it soon and fix it.

@freekmurze
Copy link
Member

Version 2.8.2 should fix these problems. Please reopen this issue if your temp folder is still filling up.

@freekmurze freekmurze reopened this Nov 23, 2015
@joedawson
Copy link

Will give it a go now as I'm free - reporting back in a moment :)

@joedawson
Copy link

forge@joe-aws:/tmp$ ls

Empty

forge@joe-aws:/tmp$ cd ~/domain.com/
forge@joe-aws:~/domain.com/$ php artisan backup:run
Start backing up
Database dumped
Determining which files should be backed up...
Start zipping 1095 files...
Zip created!
Start uploading backup to s3-filesystem...
Backup stored on s3-filesystem in file "backups/20151123221815.zip"
Backup successfully completed

Moment on truth...

forge@joe-aws:~/domain.com/$ cd /tmp/
forge@joe-aws:/tmp$ ls
laravel-backup-dbadNngv
forge@joe-aws:/tmp$

Hmm - doesn't look like it's emptying still? Also, I'm unable to open as this isn't my issue - would you like me to open another or keep this in here?

@freekmurze
Copy link
Member

Mmmm, I'll review my code again. Are you sure you're using v2.8.2?

@joedawson
Copy link

Yep, as far as I know...

composer update spatie/laravel-backup
> php artisan clear-compiled
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Removing spatie/laravel-backup (2.8.1)
  - Installing spatie/laravel-backup (2.8.2)
    Downloading: 100%

@freekmurze
Copy link
Member

ok, i found another pesky bug. My tests show that in v2.8.3 there shouldn't be any file left by this package in the tmp folder. Could you please test it again?

@joedawson
Copy link

Perfect @freekmurze, just tested this and it's no longer leaving a trace in my /tmp folder. Thank you for your attention on this, have a great week!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants