Hard Drive Free Space
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Debian support > Linux Debian support > Hard Drive Free Space




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Hard Drive Free Space  
Meat Loaf


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 10:47 PM

This is probably an easy question, but I can't figure out how to tell my
hard drive free space (or partition free space).

First off I couldn't remember the partitions or the sizes used from when I
did the install.  I used fdisk /dev/hda and fdisk /dev/hdb to print out the
partitions.  Next I typed mount to see what mount points were assigned to
each partition.  On the fdisk is the blocks equivalent to bytes? So
10,000,000 blocks would be 10MB?  I'm more use to VMS where block equals
512 bytes.  Then the final step, I guess, is how do I determine how much
space is used.  If I have that then I can subtract that from the partition
size.  The reason I'm trying to do this is I have a cron job that backs up
projects files in the /usr mount point tree to a directory in the /home
mount point tree.  I need to calculate the size of the backup tar files per
day with the free space left to schedule a clean up before I run out of
disk space.  The mount points were something like:

hda1 /boot
hda2 /
hda3 /usr
hdb1 {swap}
hdb2 /var
hdb3 /home
hdb4 /opt

Thanks







[ Post a follow-up to this message ]



    Re: Hard Drive Free Space  
Captain Dondo


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-05 10:47 PM

Meat Loaf wrote:
> This is probably an easy question, but I can't figure out how to tell my
> hard drive free space (or partition free space).

man du
man df





[ Post a follow-up to this message ]



    Re: Hard Drive Free Space  
Darshaka Pathirana


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-24-05 12:46 PM

On 2005-09-23@21:48:10, Meat Loaf <don.dayton@comcast.net> wrote:
> This is probably an easy question, but I can't figure out how to tell my
> hard drive free space (or partition free space).
>
> First off I couldn't remember the partitions or the sizes used from when I
> did the install.  I used fdisk /dev/hda and fdisk /dev/hdb to print out th
e
> partitions.  Next I typed mount to see what mount points were assigned to
> each partition.  On the fdisk is the blocks equivalent to bytes? So
> 10,000,000 blocks would be 10MB?  I'm more use to VMS where block equals
> 512 bytes.  Then the final step, I guess, is how do I determine how much
> space is used.  If I have that then I can subtract that from the partition
> size.  The reason I'm trying to do this is I have a cron job that backs up
> projects files in the /usr mount point tree to a directory in the /home
> mount point tree.  I need to calculate the size of the backup tar files pe
r
> day with the free space left to schedule a clean up before I run out of
> disk space.  The mount points were something like:
>
> hda1 /boot
> hda2 /
> hda3 /usr
> hdb1 {swap}
> hdb2 /var
> hdb3 /home
> hdb4 /opt

# df -h

HTH
- Darsha





[ Post a follow-up to this message ]



    Re: Hard Drive Free Space  
Meat Loaf


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-24-05 10:52 PM

Captain Dondo wrote:

> Meat Loaf wrote: 
>
> man du
> man df

Thanks!

Now I'm studying up on bash scripting to create the auto cleanup of old
backups so I'm sure I'll be back with questions.  This newsgroup is the
greatest!






[ Post a follow-up to this message ]



    Re: Hard Drive Free Space  
Captain Dondo


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-26-05 10:54 PM

Meat Loaf wrote:

> Now I'm studying up on bash scripting to create the auto cleanup of old
> backups so I'm sure I'll be back with questions.  This newsgroup is the
> greatest!
>

man find

:-)





[ Post a follow-up to this message ]



    Re: Hard Drive Free Space  
Meat Loaf


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-12-05 10:59 PM

Captain Dondo wrote:

> Meat Loaf wrote:
> 
>
> man find
>
> :-)
I used date to create a timestamp to be included as part of the file name.

ts=$(date +20%y%m%d)
tar -czf /home/public/backup{$ts}.tar.gz /usr/users/lnk_awd/*

By using the df command I calculated that I could safely handle 64 backup
copies, which was more than I needed.  I decided to cut it off at 4 weeks.

So I used:

ts=$(date --date='1 month ago' +20%y%m%d)
name=backup$ts.tar.gz
if [ -e $name ]
then
rm $name
fi

If there is something better I'm open for suggestions.

Thanks






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 07:50 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register