CEPHFS-SHELL(8) | Ceph | CEPHFS-SHELL(8) |
cephfs-shell - Shell-like tool talking with CephFS
cephfs-shell [options] [command] cephfs-shell [options] -- [command, command,...]
CephFS Shell provides shell-like commands that directly interact with the Ceph File System.
This tool can be used in interactive mode as well as in non-interactive mode. In former mode, cephfs-shell opens a shell session and after the given command is finished, it prints the prompt string and waits indefinitely. When the shell session is finished, cephfs-shell quits with the return value of last executed command. In non-interactive mode, cephfs-shell issues a command and exits right after the command's execution is complete with the command's return value.
Behaviour of CephFS Shell can be tweaked using cephfs-shell.conf. Refer to CephFS Shell Configuration File for details.
NOTE:
[build]$ python3 -m venv venv && source venv/bin/activate && pip3 install cmd2 colorama [build]$ source vstart_environment.sh && source venv/bin/activate && python3 ../src/tools/cephfs/shell/cephfs-shell
NOTE:
Usage :
For example,
CephFS:~/>>> !ls # Lists the local file system directory contents. CephFS:~/>>> ls # Lists the Ceph File System directory contents.
Create the directory(ies), if they do not already exist.
Usage :
Copy a file/directory to Ceph File System from Local File System.
Usage :
Copy a file from Ceph File System to Local File System.
Usage :
List all the files and directories in the current working directory.
Usage :
Concatenate files and print on the standard output
Usage :
Add a hard link to an existing file or create a symbolic link to an existing file or directory.
Usage:
Change current working directory.
Usage :
Get current working directory.
Usage :
Close the shell.
Change the permissions of file/directory.
Usage :
Moves files/Directory from source to destination.
Usage :
Delete a directory(ies).
Usage :
Remove a file(es).
Usage :
Create and Write a file.
Usage :
Lists all files and directories in the specified directory.Current local directory files and directories are listed if no path is mentioned
Usage:
Moves into the given local directory.
Usage :
Prints the absolute path of the current local directory.
Usage :
Set and get the file mode creation mask
Usage :
Define or display aliases
Usage:
Runs a python script file inside the console
Usage:
NOTE:
Invoke python command, shell, or script
Usage :
Lists shortcuts (aliases) available
Usage :
View, run, edit, and save previously entered commands.
Usage :
Unsets aliases
Usage :
Sets a settable parameter or shows current settings of parameters.
Usage :
Edit a file in a text editor.
Usage:
Runs commands in script file that is encoded as either ASCII or UTF-8 text. Each command in the script should be separated by a newline.
Usage:
NOTE:
Execute a command as if at the OS prompt.
Usage:
Find an item in File System
Usage:
Display file status.
Usage :
Create or Delete Snapshot
Usage:
Set extended attribute for a file
Usage :
Get extended attribute value for the name associated with the path
Usage :
List extended attribute names associated with the path
Usage :
Display amount of available disk space
Usage :
Show disk usage of a directory
Usage :
Quota management for a Directory
Usage :
By default, CephFS Shell looks for cephfs-shell.conf in the path provided by the environment variable CEPHFS_SHELL_CONF and then in user's home directory (~/.cephfs-shell.conf).
Right now, CephFS Shell inherits all its options from its dependency cmd2. Therefore, these options might vary with the version of cmd2 installed on your system. Refer to cmd2 docs for a description of these options.
Following is a sample cephfs-shell.conf
[cephfs-shell] prompt = CephFS:~/>>> continuation_prompt = > quiet = False timing = False colors = True debug = False abbrev = False autorun_on_edit = False echo = False editor = vim feedback_to_output = False locals_in_py = True
Following exit codes are returned by cephfs shell
Error Type | Exit Code |
Miscellaneous | 1 |
Keyboard Interrupt | 2 |
Operation not permitted | 3 |
Permission denied | 4 |
No such file or directory | 5 |
I/O error | 6 |
No space left on device | 7 |
File exists | 8 |
No data available | 9 |
Invalid argument | 10 |
Operation not supported on transport endpoint | 11 |
Range error | 12 |
Operation would block | 13 |
Directory not empty | 14 |
Not a directory | 15 |
Disk quota exceeded | 16 |
Broken pipe | 17 |
Cannot send after transport endpoint shutdown | 18 |
Connection aborted | 19 |
Connection refused | 20 |
Connection reset | 21 |
Interrupted function call | 22 |
~/.cephfs-shell.conf
2010-2024, Inktank Storage, Inc. and contributors. Licensed under Creative Commons Attribution Share Alike 3.0 (CC-BY-SA-3.0)
April 19, 2024 | dev |