I want to move large file created by external process as soon as it's closed.
Is this test command correct?
if lsof "/file/name"
then
# file is open, don't touch it!
else
if [ 1 -eq $? ]
then
# file is closed
mv /file/name /other/file/name
else
# lsof failed for some other reason
fi
fi
Aucun commentaire:
Enregistrer un commentaire