Nuclear_Man_D

Backup-Files

Jan 5th, 2017
373
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. --ignore list - keys in this table cover what won't be copied
  2. --the "true" is meaningless, this is just a handy way to lookup keys quickly
  3. local ignore={
  4.   disk=true,
  5.   rom=true,
  6.   --anything else you don't want copied add here.
  7. }
  8. local fn="disk/"..tostring(os.getComputerID())..'/'
  9. fs.makeDir(fn)
  10. --list everything in root folder...
  11. for _,filename in fs.list("")
  12.   --only stuff not in ignore list
  13.   if not ignore[filename] then
  14.         --copy
  15.         fs.copy(filename,fn..filename)
  16.   end
  17. end
  18. if fs.exists("/startup") then
  19.     shell.run("/startup")
  20. end
Advertisement
Add Comment
Please, Sign In to add comment