Jump to content




Backup Program!

utility

  • You cannot reply to this topic
7 replies to this topic

#1 KCat156

  • Members
  • 14 posts

Posted 01 October 2015 - 02: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

#2 hbomb79

  • Members
  • 352 posts
  • LocationOrewa, New Zealand

Posted 02 October 2015 - 12: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 by Hbomb_79, 02 October 2015 - 12:08 AM.


#3 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 02 October 2015 - 10:17 AM

View PostHbomb_79, on 02 October 2015 - 12:08 AM, said:

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.

#4 KCat156

  • Members
  • 14 posts

Posted 03 October 2015 - 03: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?

#5 Blue

  • Members
  • 309 posts
  • LocationGlass/UX/main.lua

Posted 03 October 2015 - 03:57 PM

View PostKittyCrafter156, on 03 October 2015 - 03:17 PM, said:

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.

#6 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

Posted 03 October 2015 - 10:56 PM

View PostGlass Systems, on 03 October 2015 - 03:57 PM, said:

*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.

#7 KCat156

  • Members
  • 14 posts

Posted 04 October 2015 - 01:58 PM

View PostGlass Systems, on 03 October 2015 - 03:57 PM, said:

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.

#8 Blue

  • Members
  • 309 posts
  • LocationGlass/UX/main.lua

Posted 04 October 2015 - 04:04 PM

View PostKittyCrafter156, on 04 October 2015 - 01:58 PM, said:

View PostGlass Systems, on 03 October 2015 - 03:57 PM, said:

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 )





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users