This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
KCat156's profile picture

Backup Program!

Started by KCat156, 01 October 2015 - 01:16 PM
KCat156 #1
Posted 01 October 2015 - 03:16 PM
I made a program to backup all your files and folders to a single pastebin file! Simply run this program, type save to save all your data to pastebin, and type load to load all files from a pastebin code. To download:

pastebin get NHkyjCTr market
market
Search Market: pastebin
Choose "Pastebin Backup"
Specify a file name to download to
hbomb79 #2
Posted 02 October 2015 - 01:08 AM
After selecting pastebin backup in market search (1), I get an error immediately.

I am running on ComputerCraft 1.74 and the error is:
Line 50
Attempt to index ? (A nil value)

The error line seems to be grabbing something from pastebin, and then trying to read it. However you have not protected your program from a nil value. If the 'pb' variable returns nil, your program will crash.

Maybe change it to something like this:

write("Filename: ")
pb=http.get("http://www.pastebin.com/raw.php?i="..marketitems[n].pastebinaddress)
if pb then
  contents=pb.readAll()
  pb.close()
  f=fs.open(read(),"w")
  f.write(contents)
  f.flush()
  f.close()
else error("Failed to fetch program from pastebin") end

This will always error 'Failed to fetch… yadada'. Maybe double check the pastebin address it is using?
I might be at fault here, but it is more probable that the pastebin ID doesn't exist and you perhaps didn't test it…
Edited on 01 October 2015 - 11:08 PM
Bomb Bloke #3
Posted 02 October 2015 - 11:17 AM
I might be at fault here, but it is more probable that the pastebin ID doesn't exist and you perhaps didn't test it…

No, you're right, the paste has apparently been removed.
KCat156 #4
Posted 03 October 2015 - 04:17 PM
IDK why it's removed, I didn't remove it. I used pastebin put to upload it. Should I have used my pb account?
Blue #5
Posted 03 October 2015 - 04:57 PM
IDK why it's removed, I didn't remove it. I used pastebin put to upload it. Should I have used my pb account?
It might have been auto-flagged for spam,altough it *should* tell you that. Try using your pastebin account,that usually helps.
Bomb Bloke #6
Posted 03 October 2015 - 11:56 PM
*should*

Even if you do use your account to upload something, if Pastebin's system decides it's spam, you won't get notified in any way when they remove it.

But yes, I'll certainly agree that you "should" be notified.
KCat156 #7
Posted 04 October 2015 - 02:58 PM
Try using your pastebin account,that usually helps.
I said should I have because the server I was on to make the backup program reset, and I forgot to save the program to my SSD.
Blue #8
Posted 04 October 2015 - 05:04 PM
Try using your pastebin account,that usually helps.
I said should I have because the server I was on to make the backup program reset, and I forgot to save the program to my SSD.
Oh,that's a shame :(/>
(also,you had to backup a backup program? Kinda ironic )