u/KaiseerKenopsia

Why does a file on my home server keep getting deleted with scp?

SOLVED: In another part of the script I had a part that renames ".txt" files and then scps them home, which probably caused scp in the snippet below to overwrite my var file on home with nothing. Thanks KlePu!

Somehow a file with a var I need on different darknet servers keeps getting deleted, when I rename the filename in these lines the new filename gets deleted too, how come?

I edited the name only in these lines, so I'm sure this is doing it somehow.

        if (ns.fileExists("var/deeepth.txt", "home") && ns.scp("var/deeepth.txt", ns.getHostname(), "home")) {
          maxDepth = Number(ns.read("var/deeepth.txt"));
        }
reddit.com
u/KaiseerKenopsia — 4 days ago