diskspace

How do I measure net used disk space change due to activity by a given process in Linux?

血红的双手。 提交于 2019-12-13 12:18:15
问题 I'd like to monitor disk space requirements of a running process. Ideally, I want to be able to point to a process and find out the net change in used disk space attributable to it. Is there an easy way of doing this in Linux? (I'm pretty sure it would be feasible, though maybe not very easy, to do this in Solaris with DTrace) 回答1: Probably you'll have to ptrace it (or get strace to do it for you and parse the output), and then try to work out what disc is being used. This is nontrivial, as

Remove working files from git repository, to save space

一个人想着一个人 提交于 2019-12-13 07:03:59
问题 I have a number of GitHub projects on my disk, but many of them are not in active use. I would like to remove the working files for the time being, because they are stored in the commit history anyway, so I can retrieve them at a later time. The easiest way to remove the files is rm -rf * but it has a number of drawbacks: It doesn't remove dotfiles such as .gitignore If I come back later, git status complains about lots of removed files. I have to work out whether I should commit these

Docker - free up space after removing all images & containers

孤街醉人 提交于 2019-12-12 13:29:39
问题 I have deleted all the images/containers ubuntu@ubuntu:/var/lib/docker$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE ubuntu@ubuntu:/var/lib/docker$ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES but I notice that there are still about 15GB inside /var/lib/docker ubuntu@ubuntu:/var/lib/docker$ sudo du --max-depth=1 -h . 12G ./volumes 104K ./aufs 4,0K ./containers 1,3M ./image 4,0K ./trust 4,0K ./swarm 2,6G ./tmp 108K ./network 15G . Questions: How can I free up this

How to export daily disk usage to csv format in shell scripting?

风流意气都作罢 提交于 2019-12-12 10:24:21
问题 My script is as below. When we run the script, it automatically saves the disk space usage in separate cells. SIZES_1=`df -h | awk 'FNR == 1 {print $1","$2","$3","$4","$5","$6}'` SIZES_2=`df -h | awk 'FNR == 2 {print $1","$2","$3","$4","$5","$6}'` SIZES_3=`df -h | awk 'FNR == 3 {print $1","$2","$3","$4","$5","$6}'` SIZES_4=`df -h | awk 'FNR == 4 {print $1","$2","$3","$4","$5","$6}'` SIZES_5=`df -h | awk 'FNR == 5 {print $1","$2","$3","$4","$5","$6}'` SIZES_6=`df -h | awk 'FNR == 6 {print $1",

Checking for available disk space in React Native

对着背影说爱祢 提交于 2019-12-12 03:28:59
问题 I have implemented the following code: Download a zip file using RNFS.downloadFile() Unzip the file using ZipArchive.unzip() Delete the zip file using RNFS.unlink() I can send info from the server indicating how big the zip file is and how big the unpacked directory is. However, how can I detect if there is enough space on the device to download and unzip the file? I assume once I figure this out I can just do a check like this: if (free_space_on_device > zip_size + unpacked_size){ proceed

FileOutputStream close when out of space

落爺英雄遲暮 提交于 2019-12-11 19:23:20
问题 I've come across a problem using FileOutputStream and BufferedWriter in Java. If my disk space is full and I'm trying to write, it will throw IOException (which is correct), but when calling the writer.close(), it will fail to close the resource, throwing another IOException and keeping the resource opened! Here is my workaround with writer.flush() . It seems to work, but is there a better way to handle this? BufferedWriter writer = null; try { writer = new BufferedWriter(new

How to find disk space of remote linux machine using Java [duplicate]

不问归期 提交于 2019-12-11 11:27:22
问题 This question already has answers here : How to find how much disk space is left using Java? (6 answers) Closed 5 years ago . I am looking for simple solution for finding total disk space and available space of a remove machine using java program. Please help Update There are questions already similar to this with primarily focus on local machine. I was looking solution for remote machine. 回答1: The easiest way to get the remote machine information and also safe way to do is to SSH to the

Java Fill preallocated File with Data (on drive)

£可爱£侵袭症+ 提交于 2019-12-11 07:04:18
问题 i want to download a videofile from the web. It is 121 MB. Now i want to pre allocate this 121 MB on the disk (with zeros or what ever) and fill it step by step with the data of the inputstream from the urlconnection. Or with other words: It doesn't matter how much has been downloaded yet - the file size is always the destinated 121MB. Is it possible? thank you 回答1: i got the solution. First of all i write the empty dummy file and then i reopen the empty file and replace the bytes: System.out

What is the fastest way to calculate disk usage per customer?

落爺英雄遲暮 提交于 2019-12-11 05:20:20
问题 I'm hoping this is a simple one. I run a Rails web app where I'm hosting about 100 school websites. The one app handles all the sites, and I have a management interface where we can add and remove schools etc... I want to add a stat to this interface which is the total disk space used by that school. Each schools files are stored in a seperate directory structure so that's easy to find out. The only problem is I need it to be fast. So the question is what's the fastest way to find this info.

Are there more efficient alternatives to ASP.NET 2.0 anonymous Profiles?

丶灬走出姿态 提交于 2019-12-11 01:46:37
问题 I discovered ASP.NET profiles a few years back and found it quick and easy to implement some powerful functionality in my web site. I ended up exclusively using "anonymous" profile properties because I am NOT using ASP.NET membership and wanted to track information and provide personalization for my site's users even though they weren't logged in. Fast forward 3 years and now I am struggling with keeping the size of my aspnetdb database within the 3 GB limit of my hosting provider. I decided