Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

30
LINES

< > BotCompany Repo | #1011898 // Upload Smart Bot's files to a server (OK)

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 10657K of libraries. Click here for Pure Java version (2124L/14K).

!7

sS user = "root", host = "botcompany.de";
sS progID = #1010745;

p {
  //set sshLogin_keepOpen;
  log4j_enableAllDebugMessages();
  File dir = programDir(progID);
  
  new L<S> 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());
}

Author comment

Began life as a copy of #1011885

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1011898
Snippet name: Upload Smart Bot's files to a server (OK)
Eternal ID of this version: #1011898/8
Text MD5: eae9c3118a0b49b20991a4a21cdcc575
Transpilation MD5: ce9722f42f69c88e8cb61c3b9809d13e
Author: stefan
Category: javax / networking
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-11-30 11:16:31
Source code size: 840 bytes / 30 lines
Pitched / IR pitched: No / No
Views / Downloads: 533 / 1206
Version history: 7 change(s)
Referenced in: