From 63cfd16b70329bad9edefbab1f7062fe957254e4 Mon Sep 17 00:00:00 2001 From: "x.zhou" Date: Mon, 25 Dec 2023 19:37:39 +0800 Subject: [PATCH] chore: update doc --- docs/datasafed.md | 20 +++++++++++++-- docs/datasafed_getconf.md | 17 ++++++++++++- docs/datasafed_list.md | 27 ++++++++++++++++----- docs/datasafed_mkdir.md | 51 +++++++++++++++++++++++++++++++++++++++ docs/datasafed_pull.md | 17 ++++++++++++- docs/datasafed_push.md | 17 ++++++++++++- docs/datasafed_rm.md | 17 ++++++++++++- docs/datasafed_rmdir.md | 22 ++++++++++++++++- docs/datasafed_stat.md | 21 +++++++++++++--- docs/datasafed_version.md | 17 ++++++++++++- 10 files changed, 209 insertions(+), 17 deletions(-) create mode 100644 docs/datasafed_mkdir.md diff --git a/docs/datasafed.md b/docs/datasafed.md index 38f356f..dce5676 100644 --- a/docs/datasafed.md +++ b/docs/datasafed.md @@ -5,14 +5,30 @@ ### Options ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") - -h, --help help for datasafed + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + -h, --help help for datasafed + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO * [datasafed getconf](datasafed_getconf.md) - Get the value of the configuration item. * [datasafed list](datasafed_list.md) - List contents of a remote directory or file. +* [datasafed mkdir](datasafed_mkdir.md) - Create an empty remote directory. * [datasafed pull](datasafed_pull.md) - Pull remote file * [datasafed push](datasafed_push.md) - Push file to remote * [datasafed rm](datasafed_rm.md) - Remove one remote file, or all files in a remote directory. diff --git a/docs/datasafed_getconf.md b/docs/datasafed_getconf.md index 839a0c4..1c3415e 100644 --- a/docs/datasafed_getconf.md +++ b/docs/datasafed_getconf.md @@ -29,7 +29,22 @@ datasafed getconf storage.access_key_id ### Options inherited from parent commands ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO diff --git a/docs/datasafed_list.md b/docs/datasafed_list.md index 4c20abb..640aad7 100644 --- a/docs/datasafed_list.md +++ b/docs/datasafed_list.md @@ -15,14 +15,14 @@ datasafed list / # List one file and extract its size datasafed list somefile.txt -o long | awk '{print $2}' -# List all files under the directory -datasafed list -r -f /some/dir +# List all files under the directory (ends with '/') +datasafed list -r -f /some/dir/ # List files modified within 1 hour and sort the result by size -datasafed list -r -f -s size --newer-than $(( $(date +%s) - 3600 )) /some/dir +datasafed list -r -f -s size --newer-than $(( $(date +%s) - 3600 )) /some/dir/ # List files with the name pattern -datasafed list --name "*.txt" /some/dir +datasafed list --name "*.txt" /some/dir/ ``` ### Options @@ -38,13 +38,28 @@ datasafed list --name "*.txt" /some/dir -o, --output-format string output format, choices: ["short" "long" "json"] (default "short") -r, --recursive list recursively --reverse reverse order - -s, --sort string sort by which field, choices: ["path" "size" "mtime"] (default "path") + -s, --sort string sort by which field, choices: ["path" "size" "mtime"], this option conflicts with --recursive ``` ### Options inherited from parent commands ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO diff --git a/docs/datasafed_mkdir.md b/docs/datasafed_mkdir.md new file mode 100644 index 0000000..0e552fd --- /dev/null +++ b/docs/datasafed_mkdir.md @@ -0,0 +1,51 @@ +## datasafed mkdir + +Create an empty remote directory. + +### Synopsis + +Remove an empty remote directory. +Some storage backends, such as S3, do not have the concept of a directory, in which case the command will directly return success with no effect. + +``` +datasafed mkdir rpath [flags] +``` + +### Examples + +``` +# Create an empty directory +datasafed mkdir some/dir +``` + +### Options + +``` + -h, --help help for mkdir +``` + +### Options inherited from parent commands + +``` + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) +``` + +### SEE ALSO + +* [datasafed](datasafed.md) - `datasafed` is a command line tool for managing remote storages. + diff --git a/docs/datasafed_pull.md b/docs/datasafed_pull.md index 98385c2..7d57ca2 100644 --- a/docs/datasafed_pull.md +++ b/docs/datasafed_pull.md @@ -29,7 +29,22 @@ datasafed pull some/path/file.txt - | wc -l ### Options inherited from parent commands ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO diff --git a/docs/datasafed_push.md b/docs/datasafed_push.md index 9ac244a..38f0fcf 100644 --- a/docs/datasafed_push.md +++ b/docs/datasafed_push.md @@ -29,7 +29,22 @@ datasafed push - remote/path/somefile.txt ### Options inherited from parent commands ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO diff --git a/docs/datasafed_rm.md b/docs/datasafed_rm.md index 4a6a408..f1461f7 100644 --- a/docs/datasafed_rm.md +++ b/docs/datasafed_rm.md @@ -26,7 +26,22 @@ datasafed rm -r some/path/to/dir ### Options inherited from parent commands ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO diff --git a/docs/datasafed_rmdir.md b/docs/datasafed_rmdir.md index 21ce6d7..4eeb938 100644 --- a/docs/datasafed_rmdir.md +++ b/docs/datasafed_rmdir.md @@ -2,6 +2,11 @@ Remove an empty remote directory. +### Synopsis + +Remove an empty remote directory. +Some storage backends, such as S3, do not have the concept of a directory, in which case the command will directly return success with no effect. + ``` datasafed rmdir rpath [flags] ``` @@ -22,7 +27,22 @@ datasafed rmdir some/dir ### Options inherited from parent commands ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO diff --git a/docs/datasafed_stat.md b/docs/datasafed_stat.md index d826996..bcefcb0 100644 --- a/docs/datasafed_stat.md +++ b/docs/datasafed_stat.md @@ -16,8 +16,8 @@ datasafed stat [--json] rpath [flags] # Stat a file datasafed stat path/to/file.txt -# Stat a directory with json output -datasafed stat -json path/to/dir +# Stat a directory (ends with '/') with json output +datasafed stat -json path/to/dir/ ``` ### Options @@ -30,7 +30,22 @@ datasafed stat -json path/to/dir ### Options inherited from parent commands ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO diff --git a/docs/datasafed_version.md b/docs/datasafed_version.md index e42efac..84371c9 100644 --- a/docs/datasafed_version.md +++ b/docs/datasafed_version.md @@ -23,7 +23,22 @@ datasafed version ### Options inherited from parent commands ``` - -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + -c, --conf string config file (default "/etc/datasafed/datasafed.conf") + --console-log Enable console log + --console-timestamps Log timestamps to stderr. (default true) + --disable-color Disable color output + --file-log-level string File log level (default "debug") + --file-log-local-tz When logging to a file, use local timezone + --force-color Force color output + --json-log-console JSON log file + --json-log-file JSON log file + --log-dir string Directory where log files should be written. + --log-dir-max-age duration Maximum age of log files to retain (default 720h0m0s) + --log-dir-max-files int Maximum number of log files to retain (default 100) + --log-dir-max-total-size-mb float Maximum total size of log files to retain (default 1000) + --log-file string Override log file. + --log-level string Console log level (default "info") + --max-log-file-segment-size int Maximum size of a single log file segment (default 50000000) ``` ### SEE ALSO