Giter VIP home page Giter VIP logo

backup's Introduction

Backup

English / فارسی

With this script, you can backup important information such as database from the x-ui, marzban, and hiddify panels and send it to Telegram with the help of the Telegram bot so that it is always available!



How does it work

Step 1: run the script

First, you run this command on your server

bash <(curl -Ls https://github.com/AC-Lover/backup/raw/main/backup.sh)

Step 2 : Token setting

Then it asks us for bot token, you have to create a bot from https://t.me/BotFather and give the token

Step 3: Set chat id

Then it asks us for a chat ID, and to get your chat ID or the channel you set aside for backup, you must forward a message from yourself or the channel to this https://t.me/userinfobot bot, which will give you a chat ID.

Step 4 : Caption setting

The next step asks you for a caption, which you can leave blank

Step 5 : Cronjob setting

The next step asks you to run a cron job to determine when the robot will back up and send
whose format is like this:
0 1
The first value, which is 0, is the minute, and the second value, which is 1, is the hour
The minimum number for minutes is 0 and the maximum is 60
The minimum number for the hour is 0 and the maximum is 24
Enter 0 for both to set backup once every minute
In the example above, it is backed up once every hour
Note that there is a space between both values

Step 6 : Panel selection

The next step will ask you which panel you want to backup
You have to choose one from marzbn, x-ui, and hiddify
The value of m means marzban, the value of x means x-ui, and the value of h means hiddify
Enter an option between x/m/h as per your requirement

Step 7 : question of removing previous crown jobs

Then it will ask you if you want to delete the previously defined cron jobs or not?
Enter y if you want it to be cleared otherwise enter n

Possible problems

If you have entered everything correctly, the backup file should be sent to you once, otherwise there is a problem in this process and you can raise your problem from the issues

Help us

I used the translator and if I have gramme problem please help me to improve it
Also, I have tested this script only on Ubuntu and developers can help us to develop this script for other operating systems.

Donation

https://nowpayments.io/donation/ACLover

Video tutorial

BackUp.mp4

Stargazers over time

Stargazers over time

backup's People

Contributors

1351438 avatar ac-lover avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

backup's Issues

بکاپ از سرور دیگر به مشکل خورده

سلام خسته نباشید. ی بکاپ ران کردم روی سرور دیگر مرزبانم. ولی وقتی دریافت میکنم میبینم از سرور قبلیم برام فرستاده. اصلا متوجه نمیشم این دوتا سرور چ ربطی به هم دارن. 🤔 حتی از یه شماره دیگم توی تلگرام بات جدید ساختم و چت ایدی اون شمارمو دادم. ولی بازم از سرور قبلیم بکاپ میگیره. من ک روی سرور جدیدم اینو ران کردم 🤔 باید از همون برام بکاپ بگیره بفرسته

مشکل بک آپ با mysql

سلام
نسخه جدید مرزبان رو نصب کردم همراه با MySql
اما متاسفانه از دیتابیس بک اپ گرفته نمیشه.
این خطا رو در سرور دریافت میکنم:

ERROR 1045 (28000): Access denied for user 'root'@'127.0.0.1' (using password: YES)
	zip warning: name not matched: /var/lib/marzban/mysql/mysql.sock
  adding: opt/marzban/docker-compose.yml (deflated 60%)
  adding: var/lib/marzban/certs/ (stored 0%)
  adding: var/lib/marzban/certs/MYDOMAIN.cer (deflated 35%)
  adding: var/lib/marzban/certs/MYDOMAIN.cer.key (deflated 15%)
  adding: var/lib/marzban/db.sqlite3 (deflated 96%)
  adding: var/lib/marzban/xray_config.json (deflated 85%)
  adding: opt/marzban/.env (deflated 46%)
	zip warning: name not matched: /var/lib/marzban/mysql/db-backup/*

zip error: Nothing to do! (try: zip -r /root/ac-backup-m.zip . -i /var/lib/marzban/mysql/db-backup/*)

مشکل php sub

سلام وقت بخیر مرسی بابت زحماتتون یه مشکلی با فوراد کردن لینک دارم اون هم اینکه زمانی که از ha-proxy استفاده میشه توی سرور دیگه جواب نمیده فایل ممنون میشم راهنمایی کنید

طریقه حذف

من اینو دوبار نصب کردم(البته دستور cornojab یکیش رو پاک کردم)
قبلی تنظیم کردم یبار در 24 ساعت بگیره(ساعت 1:30 میگرفت)
دوباره که نصب کردم بازم 24 ساعت ولی چون ساعت 12:30 نصب کردم هروز همین ساعت میگیره.(که مشکلی باهاش ندارم)
چی کار کنم قبلیه نگیره.
پیشاپیش ممنون از پاسخگویی شما

chat id

سلام برای ارسال بک آپ به کانال باید ربات رو ادمین کانال کرد یا توی مراحل نصب به جای آیدی عددی بات آیدی کانال رو داد؟

بکاپ روز نمیفرسته

سلام خسته نباشید. ی بکاپ ران کردم روی سرور مرزبان. ولی وقتی بازش میکنم بکاپ ب روز نیست و میبینم ک مال چن وقت پیشه. اکثرا همونو دوباره برام میفرسته. بعد حجم sqlite رو دو برابر بیشتر میکنه برام و انگار دیتابیس رو به هم میریزه. چیکار باید بکنم؟

کار نمیکنه

سلام وقت بخیر بعد از اینکه کرونجاب مشخص کردم این پیغام ها ظاهر میشه ولی بکاپ ارسال نمیشه
Cronjob (minutes and hours) (e.g : 30 6 or 0 12) :
24 0
x-ui or marzban or hiddify? [x/m/h] :
m
Would you like the previous crontabs to be cleared? [y/n] :
y
The folder exists at /opt/marzban
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
zip is already the newest version (3.0-12build2).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
adding: opt/marzban/docker-compose.yml (deflated 35%)
adding: var/lib/marzban/certs/ (stored 0%)
adding: var/lib/marzban/certs/.cer (deflated 37%)
adding: var/lib/marzban/certs/.cer.key (deflated 15%)
adding: var/lib/marzban/db.sqlite3 (deflated 78%)
adding: var/lib/marzban/xray_config.json (deflated 84%)
adding: opt/marzban/.env (deflated 47%)
enter new zip file comment (end with .):
{"ok":false,"error_code":400,"description":"Bad Request: chat not found"}
Done

عدم قرار دادن پوشه assets در بکاپ

سلام وقت بخیر
همونطور که میدونین فایلهای assets در مسیر زیر قرار داده میشن

/var/lib/marzban/assets

از اونجایی که حجم بالایی دارن امکانش هس تو فایل بکاپ فرستاده نشن
دانلود مجدد اینا با یه اسکریپت کار چندان سختی نیس و بنظرم نیازی نیس تو فایل بکاپ باشن بیخودی حجم رو ببرن بالا

ارسال در تایم اشتباه

سلام من کرون جاب را 0 1 تنظیم کردم که در هر یک ساعت بکاپ بگیره ولی بحای هر یک ساعت هر دقیقه داره بکاپ میگیره مشکل چیه

پنل ثنایی

سلام وقت بخیر
در مرحله 6 که انتخاب پنل هستش، پنل ثنایی بین پنل هایی که قرار دادین وجود نداره
ما ک پنل ثنایی داریم کدوم یکی رو انتخاب کنیم؟

کرون جاب

سلام به اشتباه کرونجاب رو روی 6 دقیقه ست کردم که قصد من 6 ساعت بود
حالا چطور میتونم تغییرش بدم؟

bakup limit

سلام آیا ربات واسه ارسال بکاپ به ربات محدودیت حجم داره ؟ چون شنیدم api تلگرام اجازه انتقال فایل بیشتر از 50 مگابایت رو نمیده

لوکیشن های کاستوم شده

سلام وقت بخیر
ببخشید ما لوکیشن فایل x-ui.db مون در اون لوکیشن پیشفرض نیست و در پوشه دیگه‌ایی هست
باید چیکار کنیم که بکاپ برای ما دریافت و ارسال بشه ؟ در حال حاضر با این خطا روبرو می‌شیم.
https://ibb.co/TwK0tBM

add haproxy folder

hi bro.
If possible, also add the "/etc/haproxy/*" folder to the Marzban backup. Thanks♥

{"ok":false,"error_code":413,"description":"Request Entity Too Large"}

سلام وقت بخیر در مورد اسکریپت Ac Lover چند روزی هست بک آپ نمیگیره اومدم مجدد ستاپ کنم ارور زیر رو میگیرم ، دوستان میتونن راهنمایی کنند ؟ با کوئری کلی اکانت که 60 روز از تاریخشون میگذشت رو پاک کردم ولی بازم حل نشد . هارد سرور پر شده بود که ارتقا دادم از طریق کلاد هتزنر ولی بازم ارور زیر رو میگیرم .

adding: var/lib/marzban/mysql/db-backup/marzban.sql (deflated 76%)
enter new zip file comment (end with .):
{"ok":false,"error_code":413,"description":"Request Entity Too Large"}
Don

بکاپ از سرور ایران

سلام میشه دقیق توضیح بدین چجوری میشه از روی ایران از پنل بکاپ گرفت .یکی از دوستان هم پرسیدن کامل توضیح ندادین و گفتین تلگرام پیام بدین ولی آی دی نزاشتین
میشه کامل توضیح بدین اینجا یا آی دی تلگرام بدین پیام بدم خیلی واجبه

ارور وصل نشدن

zip warning: name not matched: /usr/local/x-ui/config.json
adding: etc/x-ui/x-ui.db (deflated 89%)
enter new zip file comment (end with .):
curl: (7) Failed to connect to api.telegram.org port 443 after 23 ms: Connection refused

اين ارورو ميده مشكل چيه

mysql بکاپ نفرستادن مرزبان با دیتابیس

من مرزبان با دیتابیس mysql بالا اوردم بکاپ خودکار که ران میکنم فقط اولین بکاپ رو همون موقع میفرسته که 200کیلوبایته بعدی هارو دیگه نمیفرسته مشکل از کجاست؟؟

Feature suggestion: exclude directories

Hi, great script by the way. I was wondering if you could add an option to exclude directories inside Marzban (especially xray-core) since we may have different xray core installed, there is no need for the extra xray binary on every backup file.
If PRs are possible, I would deffinitely appreciate it.

error code 500

سلام وقت به خیر، من رباتم یهو دیروز از کار افتاد و هنگام نصب مجدد چه با توکن ربات قبلی چه با توکن جدید ارور زیر رو میده:

Cronjob (minutes and hours) (e.g : 30 6 or 0 12) :
0 1
x-ui or marzban or hiddify? [x/m/h] :
m
Would you like the previous crontabs to be cleared? [y/n] :
y
The folder exists at /opt/marzban
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
zip is already the newest version (3.0-13).
0 upgraded, 0 newly installed, 0 to remove and 5 not upgraded.
adding: opt/marzban/docker-compose.yml (deflated 62%)
adding: opt/marzban/notify/ (stored 0%)
adding: opt/marzban/notify/utils/ (stored 0%)
adding: opt/marzban/notify/utils/report.py (deflated 80%)
adding: opt/marzban/notify/telegram/ (stored 0%)
adding: opt/marzban/notify/telegram/handlers/ (stored 0%)
adding: opt/marzban/notify/telegram/handlers/report.py (deflated 77%)
adding: opt/marzban/notify/telegram/init.py (deflated 61%)
adding: opt/marzban/notify/jobs/ (stored 0%)
adding: opt/marzban/notify/jobs/review_users.py (deflated 66%)
adding: var/lib/marzban/assets/ (stored 0%)
adding: var/lib/marzban/assets/iran.dat (deflated 71%)
adding: var/lib/marzban/assets/geosite.dat (deflated 71%)
adding: var/lib/marzban/assets/geoip.dat (deflated 77%)
adding: var/lib/marzban/db.sqlite3 (deflated 77%)
adding: var/lib/marzban/xray_config.json (deflated 74%)
adding: opt/marzban/.env (deflated 44%)
enter new zip file comment (end with .):
{"ok":false,"error_code":500,"description":"Internal Server Error"}
Done

سرور ایران

سلام
در صورتی که روی سرور ایران پنل داشته باشیم
و تلگرام قیلتره
راهی هست که از کدتون استفاده کنم؟

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.