You forgot to close the
BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file));
so you'll run out of file descriptions if backing up too many files. And bis.read(jpgByte); doesn't necessary read all of the files; at least som java versions on some Solaris versions doesn't.