Koozali.org formerly Contribs.org

Documents not removing .lock files when closed on ibay

Offline Jáder

  • *
  • 1,044
    • LinuxFacil
Re: Documents not removing .lock files when closed on ibay
« Reply #15 on: December 06, 2018, 11:10:56 AM »
I'm not sure if it helps, but as a workaround you can delete those lock files every day.
I've done this for a client where LibreOffice was keeping a lot of them !
Here is the script I created. It's commented in portuguese , please try use Google Translator to understand if necessary:
Code: [Select]
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
hoje=$(date +%Y-%m-%d)
updatedb
apagados=0
for u in `locate ".~lock"`
  do
  modificado=`stat -c %z "$u" |cut -f1 -d" "`
  if [[ $modificado != $hoje ]]  ;   then
       echo Apagando "$u"
       rm -f "$u"
       apagados=$((apagados+1))
    fi
  done
echo
echo Foram apagados $apagados arquivos
echo

IFS=$SAVEIFS
...

Offline mmccarn

  • *
  • 2,337
Re: Documents not removing .lock files when closed on ibay
« Reply #16 on: December 06, 2018, 01:04:51 PM »
Do the ".lock" files appear for every office document, or only for some of them?

Is it possible that you're getting leftover ".lock" files when a user leaves a document open then either leaves with his/her laptop or lets the workstation hibernate or sleep?