We ran a couple of bench commands with the --site
option. These commands are
called site commands.
Here are some of the useful site commands.
Python Console
# access the python console
$ bench --site library.test console
Apps in this namespace:
frappe, library_management
In [1]:
MariaDB Console
# access the mariadb console
$ bench --site library.test mariadb
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 2333498
Server version: 10.4.13-MariaDB Homebrew
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [_ad03fa1a016ca1c4]>
Database Backup
$ bench --site library.test backup
Backup Summary for library.test at 2020-10-06 23:21:17.277960
Config : ./library.test/private/backups/20201006_232116-library_test-site_config_backup.json 94.0B
Database: ./library.test/private/backups/20201006_232116-library_test-database.sql.gz 217.4KiB
Backup for Site library.test has been successfully completed
You can see a list of all site commands by running the following command:
$ bench --site library.test --help
Usage: bench frappe [OPTIONS] COMMAND [ARGS]...
Options:
--site TEXT
--profile Profile
--verbose Verbose
--force Force
--help Show this message and exit.
Commands:
add-system-manager Add a new system manager to a site
add-to-email-queue Add an email to the Email Queue
add-to-hosts Add site to hosts
backup Backup
browse Opens the site on web browser
build Minify + concatenate JS and CSS files, build...
build-message-files Build message files for translation
build-search-index
bulk-rename Rename multiple records via CSV file
clear-cache Clear cache, doctype cache and defaults
clear-website-cache Clear website cache
console Start ipython console for a site
data-import Import documents in bulk from CSV or XLSX...
destroy-all-sessions Clear sessions of all users (logs them out)