filesystem on davidchua https://dchua.com/tags/filesystem/ Recent content in filesystem on davidchua Hugo -- gohugo.io en-us Fri, 03 Feb 2017 00:00:00 +0000 Deleting files and getting your diskspace back without rebooting https://dchua.com/posts/2017-02-03-deleting-files-and-getting-your-diskspace-back-without-rebooting/ Fri, 03 Feb 2017 00:00:00 +0000 https://dchua.com/posts/2017-02-03-deleting-files-and-getting-your-diskspace-back-without-rebooting/ When you run out of diskspaces and need to delete files quickly to recover them, most of the time, your deleted files will not free up the diskspace until the process that is using it is restarted or deleted. To force the filesystem to free up the lock to the file so that the files can be cleared up, you’d need to find the process that is using the file and truncate it. Monitor a Directory for File Changes with inotifywait https://dchua.com/posts/2016-12-27-monitor-a-directory-for-file-changes-with-inotifywait/ Tue, 27 Dec 2016 00:00:00 +0000 https://dchua.com/posts/2016-12-27-monitor-a-directory-for-file-changes-with-inotifywait/ Sometimes there may be a need to monitor and be alerted when any new files have been added in a particular directory. One of the quickest way to do that is to use inotifywait. You can find it in the inotify-tools package. If you don’t have it yet, you can install it with apt-get install inotify-tools if you’re on Debian/Ubuntu. Create a nice looking bash script. Maybe something called watcher.sh, copy the following script and fire away!