Hi all,
FreeBSD 7.1-RELEASE
I have a strange issue and don't know where to look to it's resolution.
The following code produces two different results depending on if it's run from the command line or from a cron job...
From a cron job it is exactly twice the block count.
Any ideas??
Command line:
user Cron job:
Example output from command line
Example output from a crontab
And the code. (to run, TARGET needs to be edited)
Thanks all!
-Enjoy
fh : )_~
FreeBSD 7.1-RELEASE
I have a strange issue and don't know where to look to it's resolution.
The following code produces two different results depending on if it's run from the command line or from a cron job...
From a cron job it is exactly twice the block count.
Any ideas??
Command line:
Code:
sh SpaceUsed.sh
Code:
30 4 * * * /path_to/SpaceUsed.sh
Code:
Space used: 912924
Code:
Space used: 1825848
Code:
#!/bin/sh
#set -x
TARGET="/path"
LOGNAME="test.log"
SpaceUsed()
{
# for demo simplicity
du -s "${1}" | cut -f1
# echo $(($(du -s "${1}" | cut -f1) * 1024)) | sed -e :x -e 's/\([0-9][0-9]*\)\([0-9][0-9][0-9]\)/\1,\2/' -e 'tx'
}
echo " Space used: $(SpaceUsed ${TARGET})" >> ${TARGET}/${LOGNAME}
exit 0
Thanks all!
-Enjoy
fh : )_~