Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX FOR MAKING AUTO_BACKUP PLUGIN WORK! #30

Open
qkum opened this issue Mar 19, 2021 · 5 comments
Open

FIX FOR MAKING AUTO_BACKUP PLUGIN WORK! #30

qkum opened this issue Mar 19, 2021 · 5 comments

Comments

@qkum
Copy link

qkum commented Mar 19, 2021

The Readme/guide/tutorial is outdated.

Don't waste time copy-pasting the code in and think it will work after.

You need to tinker with it yourself to make it work after they changed to using the .toml format without updating the readme file.

It seems you need to add pretty much the same lines of code though but change them so they look like the rest of the code in the config.yml file.

@qkum
Copy link
Author

qkum commented Mar 19, 2021

Ok, I found out what the changes are.

1# Here is the UPDATED code you need to add to /root/etc/pwnagotchi/config.toml to make the auto_backup plugin work:

main.plugins.auto_backup.enabled = true
main.plugins.auto_backup.interval = 1 # Every X Days
main.plugins.auto_backup.max_tries = 10
main.plugins.auto_backup.files = [
"/root/brain.nn",
"/root/brain.json",
"/root/.api-report.json",
"/root/handshakes/",
"/root/peers/",
"/etc/pwnagotchi/",
"/var/log/pwnagotchi.log"]
main.plugins.auto_backup.commands = "tar czf /root/pwnagotchi-backup.tar.gz {files}"

This is how it should look like after:
after_backup_settings

2# Here is the line of code you need to change to where YOU put YOUR "pwnagotchi-plugins-contrib" unzipped folder/directory. This will make Pwnagotchi load ALL the custom plugins you got in that folder automatically. But you need to set the settings for every plugin manually in the config file just as we just did with the auto_backup plugin. No Settings = no working plugin even if it is loaded
Change path

Use this command in terminal to Manually back up:
sudo tar czf /root/pwnagotchi-backup.tar.gz {files}

It creates a backup file called "pwnagotchi-backup.tar.gz" in the "/root/" directory. (1# sudo -i #2 ls )
Just like it will do automatically if the plugin is enabled.
It will print an error but still creates the backup file.
It over-writes the old backup file every time it backs up.

Have fun and enjoy :)

@qkum qkum changed the title Readme/guide/tutorial is outdated FIX FOR MAKING AUTO_BACKUP PLUGIN WORK! Mar 19, 2021
@qkum
Copy link
Author

qkum commented Mar 19, 2021

Everybody who can't code and read this - YOU NEED TO START LEARNING IT NOW!

I started 2 years ago in my free time and now I can fix this kind of stuff 🚀 🚀 🚀
Just go and buy 10-15 dollar Python course's on udemy.com as I did.
Just sign up and you get 90% off.

@MaddoScientisto
Copy link

For whoever will stumble on this page and be confused like me on why it's not working:
the main.plugins.auto_backup.commands = "tar czf /root/pwnagotchi-backup.tar.gz {files}"
is wrong and should be an array
it should look like this:

main.plugins.auto_backup.commands = [ 
 "tar czf /root/pwnagotchi-backup.tar.gz {files}"
]

@Travid
Copy link

Travid commented Jan 9, 2022

Sorry to wake up this thread, but thanks Maddo!
Also, I've added a date string to it so I can have more than one day's backup.

main.plugins.auto_backup.commands = [ 
"tar czf /root/pwnagotchi-backup$(date +%d-%m-%Y).tar.gz {files}"
]

@MaddoScientisto
Copy link

Sorry to wake up this thread, but thanks Maddo! Also, I've added a date string to it so I can have more than one day's backup.

main.plugins.auto_backup.commands = [ 
"tar czf /root/pwnagotchi-backup$(date +%d-%m-%Y).tar.gz {files}"
]

I actually did that myself but forgot to post it, woops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants