public static void main(String[] args) throws MessagingException {

              File backupLocation = new File("/home/to_move/");
              File archiveLocation = new File("/home/server/backup/");
       
            try {
                    File oldestBackupDir = findOldestBackup(backupLocation);
                    createTarGzOfDirectory(oldestBackupDir.getAbsolutePath(),archiveLocation.getAbsolutePath()+"/"+oldestBackupDir.getName()+".tar.gz");
                    File tarredAndZippedFile = new File(archiveLocation.getAbsolutePath()+"/"+oldestBackupDir.getName()+".tar.gz");
                    if (tarredAndZippedFile.exists()){
                        tarredAndZippedFile.deleteOnExit();
                        uploadFileWithSCP(tarredAndZippedFile);
                        //TODO add sync check?
                } else {
                    //mailsender.sendMail("the tar and gzip failed");
                }
            } catch (Exception e) {
               //mailsender.sendMail(e.getMessage());
            }
        }