Skip to main content

/tmp/systemd-private-foo/tmp/ getting full

Comments

8 comments

  • quietFinn
    Have you seen this thread?
    0
  • GoWilkes
    I did, that's where I found the tip to check session.save_path :-) Mine was set to /tmp, though, so his solution didn't help. The links to the other threads provided no insight, either.
    0
  • GoWilkes
    I was finally able to get in to the large directory, and I see that the files are simply session files from my PHP scripts. I don't understand why they're in this subdirectory instead of just /tmp, but it's causing a real problem! I'm having to manually delete them twice a day! Knowing this to be the problem, though, I was able to research further and found this:
    0
  • cPRex Jurassic Moderator
    Trust, but verify. You can run the first portion of the command without the "rm" component to get a list of what will be removed: find /tmp/systemd-private*php-fpm.service* -name sess_* ! -mtime -1
    0
  • GoWilkes
    @cPRex, how do I make that a cron? Minor update: I found this article: and restarted PHP-FPM. That had no impact, though, other than changing the name of the systemd-private directory :-/
    0
  • cPRex Jurassic Moderator
    You wouldn't want to make the command without the "rm" portion a cron, as that won't be very helpful. That's just a "run this once to ensure you're not deleting anything you don't want" command. If you wanted to set this up as a cron, it would need to be done as the root user.
    0
  • GoWilkes
    I understood that, haha :-) I'm asking, once I know it's working right, how do I set it as a cron with rm? The article wasn't clear. Would this be correct (using 22 to make it run at 11pm, per the article)? 0 22 * * * find /tmp/systemd-private*php-fpm.service* -name sess_* ! -mtime -1 -exec rm -f '{}' \;
    0
  • cPRex Jurassic Moderator
    That looks fine to me, although you may find you have to call the full path to /usr/bin/find inside cron.
    0

Please sign in to leave a comment.