2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-09-03 23:35:08 +00:00

Add docs for the sync-config command

This commit is contained in:
Diego Ximenez
2025-03-18 21:06:03 +01:00
parent dbcd5610aa
commit 10ec6b01d7
7 changed files with 52 additions and 12 deletions

View File

@@ -218,6 +218,7 @@ Verbosity: You can increase the amount of information given by any command by pa
* [`sync`](contrib/docs/commands/sync.md)`[localpath dstremotepath| [-dpe] [ID|localpath]` Controls synchronizations. * [`sync`](contrib/docs/commands/sync.md)`[localpath dstremotepath| [-dpe] [ID|localpath]` Controls synchronizations.
* [`sync-issues`](contrib/docs/commands/sync-issues.md)`[[--detail (ID|--all)] [--limit=rowcount] [--disable-path-collapse]] | [--enable-warning|--disable-warning]` Show all issues with current syncs * [`sync-issues`](contrib/docs/commands/sync-issues.md)`[[--detail (ID|--all)] [--limit=rowcount] [--disable-path-collapse]] | [--enable-warning|--disable-warning]` Show all issues with current syncs
* [`sync-ignore`](contrib/docs/commands/sync-ignore.md)`[--show|[--add|--add-exclusion|--remove|--remove-exclusion] filter1 filter2 ...] (ID|localpath|DEFAULT)` Manages ignore filters for syncs * [`sync-ignore`](contrib/docs/commands/sync-ignore.md)`[--show|[--add|--add-exclusion|--remove|--remove-exclusion] filter1 filter2 ...] (ID|localpath|DEFAULT)` Manages ignore filters for syncs
* [`sync-config`](contrib/docs/commands/sync-config.md)`[--delayed-uploads-wait-seconds=waitsecs | --delayed-uploads-max-attempts=attempts]` Shows and modifies global sync configuration.
* [`exclude`](contrib/docs/commands/exclude.md)`[(-a|-d) pattern1 pattern2 pattern3]` Manages default exclusion rules in syncs. * [`exclude`](contrib/docs/commands/exclude.md)`[(-a|-d) pattern1 pattern2 pattern3]` Manages default exclusion rules in syncs.
* [`backup`](contrib/docs/commands/backup.md)`(localpath remotepath --period="PERIODSTRING" --num-backups=N | [-lhda] [TAG|localpath] [--period="PERIODSTRING"] [--num-backups=N]) [--time-format=FORMAT]` Controls backups * [`backup`](contrib/docs/commands/backup.md)`(localpath remotepath --period="PERIODSTRING" --num-backups=N | [-lhda] [TAG|localpath] [--period="PERIODSTRING"] [--num-backups=N]) [--time-format=FORMAT]` Controls backups
@@ -241,7 +242,6 @@ Verbosity: You can increase the amount of information given by any command by pa
* [`cat`](contrib/docs/commands/cat.md)`remotepath1 remotepath2 ...` Prints the contents of remote files * [`cat`](contrib/docs/commands/cat.md)`remotepath1 remotepath2 ...` Prints the contents of remote files
* [`clear`](contrib/docs/commands/clear.md) Clear screen * [`clear`](contrib/docs/commands/clear.md) Clear screen
* [`codepage`](contrib/docs/commands/codepage.md)`[N [M]]` Switches the codepage used to decide which characters show on-screen. * [`codepage`](contrib/docs/commands/codepage.md)`[N [M]]` Switches the codepage used to decide which characters show on-screen.
* [`command`](contrib/docs/commands/command.md)`not found` :
* [`confirmcancel`](contrib/docs/commands/confirmcancel.md)`link password` Confirms the cancellation of your MEGA account * [`confirmcancel`](contrib/docs/commands/confirmcancel.md)`link password` Confirms the cancellation of your MEGA account
* [`debug`](contrib/docs/commands/debug.md) Enters debugging mode (HIGHLY VERBOSE) * [`debug`](contrib/docs/commands/debug.md) Enters debugging mode (HIGHLY VERBOSE)
* [`deleteversions`](contrib/docs/commands/deleteversions.md)`[-f] (--all | remotepath1 remotepath2 ...) [--use-pcre]` Deletes previous versions. * [`deleteversions`](contrib/docs/commands/deleteversions.md)`[-f] (--all | remotepath1 remotepath2 ...) [--use-pcre]` Deletes previous versions.

View File

@@ -0,0 +1,14 @@
### sync-config
Shows and modifies global sync configuration.
Usage: `sync-config [--delayed-uploads-wait-seconds=waitsecs | --delayed-uploads-max-attempts=attempts]`
<pre>
Displays current configuration if no options are provided. Configuration values are persisted across restarts.
New uploads for files that change frequently in syncs will be delayed until a wait time passes.
Options:
--delayed-uploads-wait-seconds Sets the seconds to be waited before a file that's being delayed is uploaded again. Default is 30 minutes (1800 seconds).
Note: wait seconds must be between 60 and 86399 (inclusive).
--delayed-uploads-max-attempts Sets the max number of times a file can change in quick succession before it starts to get delayed. Default is 2.
Note: max attempts must be between 2 and 5 (inclusive).
</pre>

View File

@@ -4,12 +4,10 @@ Controls synchronizations.
Usage: `sync [localpath dstremotepath| [-dpe] [ID|localpath]` Usage: `sync [localpath dstremotepath| [-dpe] [ID|localpath]`
<pre> <pre>
If no argument is provided, it lists current configured synchronizations. If no argument is provided, it lists current configured synchronizations.
If local and remote paths are provided, it will start synchronizing a local folder into a remote folder.
If an ID/local path is provided, it will list such synchronization unless an option is specified.
If provided local and remote paths, it will start synchronizing Note: use the "sync-config" command to show and modify global sync configuration.
a local folder into a remote folder.
If an ID/local path is provided, it will list such synchronization
unless an option is specified.
Options: Options:
-d | --delete ID|localpath deletes a synchronization (not the files). -d | --delete ID|localpath deletes a synchronization (not the files).

View File

@@ -121,7 +121,7 @@ def get_commands_by_category(ct):
'Account / Contacts': ['signup', 'confirm', 'invite', 'showpcr', 'ipc', 'users', 'userattr', 'passwd', 'masterkey'], 'Account / Contacts': ['signup', 'confirm', 'invite', 'showpcr', 'ipc', 'users', 'userattr', 'passwd', 'masterkey'],
'Login / Logout': ['login', 'logout', 'whoami', 'session', 'killsession'], 'Login / Logout': ['login', 'logout', 'whoami', 'session', 'killsession'],
'Browse': ['cd', 'lcd', 'ls', 'pwd', 'lpwd', 'attr', 'du', 'find', 'mount'], 'Browse': ['cd', 'lcd', 'ls', 'pwd', 'lpwd', 'attr', 'du', 'find', 'mount'],
'Moving / Copying files': ['mkdir', 'cp', 'put', 'get', 'preview', 'thumbnail', 'mv', 'rm', 'transfers', 'speedlimit', 'sync', 'sync-issues', 'sync-ignore', 'exclude', 'backup'], 'Moving / Copying files': ['mkdir', 'cp', 'put', 'get', 'preview', 'thumbnail', 'mv', 'rm', 'transfers', 'speedlimit', 'sync', 'sync-issues', 'sync-ignore', 'sync-config', 'exclude', 'backup'],
'Sharing (your own files, of course, without infringing any copyright)': ['export', 'import', 'share', 'webdav'], 'Sharing (your own files, of course, without infringing any copyright)': ['export', 'import', 'share', 'webdav'],
'FUSE (mount your cloud folder to the local system)': ['fuse-add', 'fuse-remove', 'fuse-enable', 'fuse-disable', 'fuse-show', 'fuse-config'], 'FUSE (mount your cloud folder to the local system)': ['fuse-add', 'fuse-remove', 'fuse-enable', 'fuse-disable', 'fuse-show', 'fuse-config'],
} }

2
src/client/mega-sync-config Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/bash
mega-exec sync-config "$@"

View File

@@ -0,0 +1,2 @@
@echo off
"%~dp0MegaClient.exe" sync-config %*

View File

@@ -1787,6 +1787,10 @@ const char * getUsageStr(const char *command, const HelpFlags& flags)
{ {
return "sync-ignore [--show|[--add|--add-exclusion|--remove|--remove-exclusion] filter1 filter2 ...] (ID|localpath|DEFAULT)"; return "sync-ignore [--show|[--add|--add-exclusion|--remove|--remove-exclusion] filter1 filter2 ...] (ID|localpath|DEFAULT)";
} }
if (!strcmp(command, "sync-config"))
{
return "sync-config [--delayed-uploads-wait-seconds=waitsecs | --delayed-uploads-max-attempts=attempts]";
}
if (!strcmp(command, "backup")) if (!strcmp(command, "backup"))
{ {
return "backup (localpath remotepath --period=\"PERIODSTRING\" --num-backups=N | [-lhda] [TAG|localpath] [--period=\"PERIODSTRING\"] [--num-backups=N]) [--time-format=FORMAT]"; return "backup (localpath remotepath --period=\"PERIODSTRING\" --num-backups=N | [-lhda] [TAG|localpath] [--period=\"PERIODSTRING\"] [--num-backups=N]) [--time-format=FORMAT]";
@@ -2580,12 +2584,10 @@ string getHelpStr(const char *command, const HelpFlags& flags = {})
os << "Controls synchronizations." << endl; os << "Controls synchronizations." << endl;
os << endl; os << endl;
os << "If no argument is provided, it lists current configured synchronizations." << endl; os << "If no argument is provided, it lists current configured synchronizations." << endl;
os << "If local and remote paths are provided, it will start synchronizing a local folder into a remote folder." << endl;
os << "If an ID/local path is provided, it will list such synchronization unless an option is specified." << endl;
os << endl; os << endl;
os << "If provided local and remote paths, it will start synchronizing" << endl; os << "Note: use the \"sync-config\" command to show and modify global sync configuration." << endl;
os << " a local folder into a remote folder." << endl;
os << endl;
os << "If an ID/local path is provided, it will list such synchronization" << endl;
os << " unless an option is specified." << endl;
os << endl; os << endl;
os << "Options:" << endl; os << "Options:" << endl;
os << " -d | --delete" << " " << "ID|localpath" << "\t" << "deletes a synchronization (not the files)." << endl; os << " -d | --delete" << " " << "ID|localpath" << "\t" << "deletes a synchronization (not the files)." << endl;
@@ -2696,6 +2698,28 @@ string getHelpStr(const char *command, const HelpFlags& flags = {})
os << endl; os << endl;
os << "See: https://help.mega.io/installs-apps/desktop/megaignore more info." << endl; os << "See: https://help.mega.io/installs-apps/desktop/megaignore more info." << endl;
} }
else if (!strcmp(command, "sync-config"))
{
auto duLimits = GlobalSyncConfig::DelayedUploads::getCurrentLimits(*api);
os << "Shows and modifies global sync configuration." << endl;
os << endl;
os << "Displays current configuration if no options are provided. Configuration values are persisted across restarts." << endl;
os << endl;
os << "New uploads for files that change frequently in syncs will be delayed until a wait time passes." << endl;
os << "Options:" << endl;
os << " --delayed-uploads-wait-seconds Sets the seconds to be waited before a file that's being delayed is uploaded again. Default is 30 minutes (1800 seconds)." << endl;
if (duLimits)
{
os << " Note: wait seconds must be between " << duLimits->mLower.mWaitSecs << " and " << duLimits->mUpper.mWaitSecs << " (inclusive)." << endl;
}
os << " --delayed-uploads-max-attempts Sets the max number of times a file can change in quick succession before it starts to get delayed. Default is 2." << endl;
if (duLimits)
{
os << " Note: max attempts must be between " << duLimits->mLower.mMaxAttempts << " and " << duLimits->mUpper.mMaxAttempts << " (inclusive)." << endl;
}
}
else if (!strcmp(command, "backup")) else if (!strcmp(command, "backup"))
{ {
os << "Controls backups" << endl; os << "Controls backups" << endl;