Folder actions question
ok, so i guess this is a two part question. one, can it do this. two, can anyone help me out on it, as i'm completely lost with applescript.
i'm doing some automated backups at work. i realized the other day it would be nice to see how quickly the backup files are growing. it would help me decide when i'll need to buy new hardware, who might be using up too much space etc.
however, going in every day and logging the file sizes sounds like a pain in the ass. no way i'm going to remember to do it every day, so i'd like to be able to have a script that does it for me.
what i'd like is a script that takes the files name and size info, and enters it into an excel file. is that possible?
i'm doing some automated backups at work. i realized the other day it would be nice to see how quickly the backup files are growing. it would help me decide when i'll need to buy new hardware, who might be using up too much space etc.
however, going in every day and logging the file sizes sounds like a pain in the ass. no way i'm going to remember to do it every day, so i'd like to be able to have a script that does it for me.
what i'd like is a script that takes the files name and size info, and enters it into an excel file. is that possible?
Comments
as of now i've got approx. 1.5 TB of storage, and i'm sure there will be more in the future.
the data files are the only ones i care about, but i wouldn't mind getting the catalog file info as well.
I think this is very well possible through AS. I will have a look.
This is the code to get the size of any folder. But not to get the size of each of the files...
set byteSize to size of (info for alias "your
set size_ to convertByteSize from byteSize
to convertByteSize from byteSize -- by Nigel Garvey
if byteSize is greater than or equal to 1.099511627776E+12 then -- Terabytes (2 ^ 40)
((byteSize / 1.099511627776E+12 div 0.01 / 100.0) as string) & " TB"
else if byteSize is greater than or equal to 1.073741824E+9 then -- Gigabytes (2 ^ 30)
((byteSize / 1.073741824E+9 div 0.01 / 100.0) as string) & " GB"
else if byteSize is greater than or equal to 1048576 then -- Megabytes (2 ^ 20)
((byteSize / 1048576 div 0.01 / 100.0) as string) & " MB"
else if byteSize is greater than or equal to 1024 then -- Kilobytes (2 ^ 10)
((byteSize div 1024) as string) & " K"
else
(byteSize as string) & " bytes"
end if
end convertByteSize
Thing is, I've tried a lot now, but I don't want to spend more time on it.
I'm not much help with the details, though. There must be a "filesize" shell command, but I don't know what it is. You could probably dump the output of "ls -l", parse it with sed, append the date, and output it to a text file.