I'm trying to check backuped file on our S3 bucket
using getsize
.
I think it's not possible to use this function with the s3 wrapper
.
Any alternative?
Here is my code:
def check_created_file(self,destination) :
if destination != None :
files = os.popen("hdfs dfs -ls %s | awk {'print $8'}"%(destination)).read().split("\n")
files = files[1::len(files)-1]
for file in files :
if os.path.getsize(file) > 0 :
print file
else:
print " [*] WARNING "
print "%s is empty"%(file)
else:
raise Exception("Remote dir is not specified")
the error I am getting:
OSError: [Errno 2] No such file or directory