!7 sS user = "root", host = "botcompany.de"; sS progID = #1010745; p { //set sshLogin_keepOpen; log4j_enableAllDebugMessages(); File dir = programDir(progID); new L names; for (RemoteResourceInfo info : scpLS(user, host, "JavaX-Data/" + fsI(progID))) names.add(info.getName()); int i = 0; S bak; do { bak = "backup" + (++i); } while (names.contains(bak)); S backupDir = "JavaX-Data/" + fsI(progID) + "/" + bak; scpMkdir(user, host, backupDir); for (RemoteResourceInfo info : scpLS(user, host, "JavaX-Data/" + fsI(progID))) if (info.isRegularFile()) scpRename(user, host, info.getPath(), backupDir + "/" + info.getName()); for (File f : listFilesOnly(dir)) scpUploadFile(f, user, host, "JavaX-Data/" + fsI(progID) + "/" + f.getName()); }