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(backups): setup backups for bench sites #972

Merged
merged 3 commits into from
Apr 17, 2020

Conversation

gavindsouza
Copy link
Collaborator

Using python-crontab library instead of manual processing

INFO:bench.utils:setting up backups
no crontab for revant
SUCCESS: Bench fbench initialized
crontab: usage error: file name or - (for stdin) must be specified for replace
Usage:
 crontab [options] file
 crontab [options]
 crontab -n [hostname]

Options:
 -u <user>  define user
 -e         edit user's crontab
 -l         list user's crontab
 -r         delete user's crontab
 -i         prompt before deleting
 -n <host>  set host in cluster to run users' crontabs
 -c         get host in cluster to run users' crontabs
 -V         print version and exit
 -x <mask>  enable debugging

Default operation is replace, per 1003.2

Reference: #967 (comment)

Using python-crontab library instead of manual processing
@gavindsouza gavindsouza requested a review from revant April 16, 2020 05:48
Copy link
Collaborator

@revant revant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❯ cd /tmp
❯ bench init --skip-redis-config-generation fbench --skip-assets
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

WARN: Command not being executed in bench directory
$ /home/revant/.local/bin/virtualenv -q env -p python3
INFO:bench.app:Getting app frappe
$ git clone https://github.com/frappe/frappe.git  --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 2737, done.
remote: Counting objects: 100% (2737/2737), done.
remote: Compressing objects: 100% (2509/2509), done.
remote: Total 2737 (delta 397), reused 1052 (delta 164), pack-reused 0
Receiving objects: 100% (2737/2737), 12.83 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (397/397), done.
INFO:bench.app:installing frappe
$ fbench/env/bin/pip install -q -U -e fbench/apps/frappe 
INFO:bench.utils:setting up backups
Please specify user or filename to write.
ERROR: There was a problem while creating fbench
Do you want to rollback these changes? [Y/n]: 

@gavindsouza gavindsouza requested a review from revant April 17, 2020 05:58
Copy link
Collaborator

@revant revant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❯ bench init --skip-redis-config-generation fbench --skip-assets
WARN: bench is installed in editable mode!

This is not the recommended mode of installation for production. Instead, install the package from PyPI with: `pip install frappe-bench`

WARN: Command not being executed in bench directory
$ /home/revant/.local/bin/virtualenv -q env -p python3
INFO:bench.app:Getting app frappe
$ git clone https://github.com/frappe/frappe.git  --depth 1 --origin upstream
Cloning into 'frappe'...
remote: Enumerating objects: 2739, done.
remote: Counting objects: 100% (2739/2739), done.
remote: Compressing objects: 100% (2511/2511), done.
remote: Total 2739 (delta 396), reused 1050 (delta 164), pack-reused 0
Receiving objects: 100% (2739/2739), 12.83 MiB | 123.00 KiB/s, done.
Resolving deltas: 100% (396/396), done.
INFO:bench.app:installing frappe
$ fbench/env/bin/pip install -q -U -e fbench/apps/frappe 
INFO:bench.utils:setting up backups
SUCCESS: Bench fbench initialized

LGTM

@gavindsouza gavindsouza merged commit 264df52 into frappe:develop Apr 17, 2020
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

Successfully merging this pull request may close these issues.

2 participants