Can I safely delete gitlab-shell.log?

Sorry if this is a noob question. My server is low on disk space. I see that gitlab-shell.log is 1.6GB with entries going back much farther than is useful. I checked the documentation and it seems that this file isn’t just a simple log. The phrasing makes it sound as if this file contains important information such as SSH keys. How can I safely reclaim space used by this file?

Hi benjit,

I would request you to take a backup of this file, using below command

cd /<LOCATION_OF_LOGFILE>
tar -cvzf /<BACKUP_LOCATION/gitlab-shell.log.tar.gz gitlab-shell.log

And then run this command to empty this file

echo > gitlab-shell.log

Top of that it would be great if you could modify your log rotation for this file on size basis.

/etc/gitlab/gitlab.rb

And change the default setting according to your requirement and do not forget to uncomment the below line

logging[‘svlogd_size’] = 200 * 1024 * 1024 # rotate after 200 MB of log data

Thanks

1 Like