Deployment synchronization tool
Project description
Usage
General information
When you run the command in a directory that is known to the configuration (host and path both match), the default project and deployment are determined automatically and used in subsequent commands.
In that case there is no need to issue --project or --deployment commands
--workdir: The working directory for wesync. Default is ~/wesync--verbose: Additional working information--debug: Also print debug messages--stash: The directory of the stash, relative to workdir. Default is stash
Snapshots
Snapshots are locally stored backups of the project according to it's configuration or type
It usually contains the database and one or more file archives.
Create a new snapshot
wesync snapshot export --project <projectName> --deployment <deploymentName> [--only-database] [label]
This saves a snapshot locally.
labelSets the label for the export. A random hex will be generated if missing
Restore a snapshot
wesync snapshot import --project <projectName> --deployment <deploymentName> [--only-database] [--label <label>] [--path <path>]
This uses the local snapshot to restore the project database and files
--only-database: This flag export/imports only the database from the snapshotlabel: Import the snapshot by the specified labelpath: Import the snapshot using the specified path.
If both path and label are missing, the most recent snapshot for the project will be imported.
List snapshot
wesync snapshot list --project <projectName>
This list snapshots for the specified project. If project is omitted all snapshots are listed
Delete snapshots
wesync snapshot delete --project <projectName> --label <label> --path <path>
Delete a snapshot either by label or path. Project is required when deleting a single snapshot.
Purge all snapshots
wesync snapshot purge --project <projectName>
Delete all snapshots for a project. If project name is omitted all snapshots will be deleted for all projects.
Sync
The sync command uses different strategies to export data from a project and import it in another project in the same command The command requires a project, a source and destination deployment
wesync sync --project <projectName> sourceDeployment destinationDeployment [--sync-strategy] [--only-database]
--only-database: This flag syncs only the database between deployments--sync-strategy: Determines the method that sync will use. Options are described below
Sync strategies
snapshot: Export a snapshot on the sourceDeployment, copy it to the destinationDeployment using rsync, and import itsnapshotScp: Same as snapshot, but transfer the data using scp instead of rsyncscp: Stream the database and copy the files from source location to destination location using SCPrsync: Stream the database and sync the files from source location to destination location using rsync
Streaming the database implies piping the database export to the database import command
Backups
The backup command uploads a project snapshot it to the backup location using SFTP.
wesync backup --project <projectName> push --backup my_location --label 37fca811 --replace --latest
--label <label>: Label of the snapshot the will be pushed--backup <name>: Name of the configured backup location--replace: If the backup already exists on the backup location, replace it.--latest: Copy/restore the backup data to/from the latest folder. Overwrites the previous content
Push & Pull
Use a label to identify the snapshot and then push it to backup or pull it from backup locally
Export && Import
Export a snapshot and push it backup or fetch a snapshot from backup and import it
Other commands
Configuration update/push
- Create a new work directory
wesync config init
- Purge the work directory
wesync config purge [--full]
--full: Delete entire directory, not just configuration
- update / commmit
wesync config update|commit
Fetches new configuration from the repository or commits changes and pushed to remote
Building
Install build tools
pip3 install --upgrade build
pip3 install virtualenv
Go to project root directory and run build module
python3 -m build
Find the whl file and install it globally (for testing)
pip3 install --force-reinstall dist/wesync-0.0.1-py3-none-any.whl
Test the package:
wesync --help
python3
>>> import wesync
python3 -m wesync
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wesync-0.0.4.post3.tar.gz.
File metadata
- Download URL: wesync-0.0.4.post3.tar.gz
- Upload date:
- Size: 38.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d27ef60f3201abb27dce24e53cff1f9d7bb860d730c426e4064cbb6f6bb67a0b
|
|
| MD5 |
e3adc2a06b74a7ef456fdceeb42cd939
|
|
| BLAKE2b-256 |
d844867b5f1580a0437454e88256e04cd54a9701812aa809230776e1bca5f587
|
File details
Details for the file wesync-0.0.4.post3-py3-none-any.whl.
File metadata
- Download URL: wesync-0.0.4.post3-py3-none-any.whl
- Upload date:
- Size: 73.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b10d01bbb1e5e84910da69d2b5a0fd921f749d6c03111ecb0706f26cd7eb6a91
|
|
| MD5 |
3f59419d110e37b3f0d1b90c33167987
|
|
| BLAKE2b-256 |
d235aa68722a123786d6500e005f246fb172342ecdf586aeec6cdb11d9e901c7
|