Commands and parameters

Commands

Use the following commands to work with the client:

  • token: Get an authorization key (OAuth token) for your Yandex username (USERNAME). When entering the command, you can enter your Yandex password (PASSWORD) as well as the token file and its directory (FILE). If no additional options are specified, the passwd file will be created in ~/.config/yandex-disk to store the token.
    $ yandex-disk token [-p, --password=PASSWORD] [OPTION] USERNAME [FILE]
  • start: Launch the daemon and sync all folders except those on the exclude-dirs exclusion list.
    $ yandex-disk start [OPTION]
  • status: Display the daemon's status (sync status, sync errors, list of synced files, and total and available space on Yandex.Disk).
    $ yandex-disk status [OPTION]
  • stop: Stop the daemon.
    $ yandex-disk stop [OPTION]
  • sync: Sync all folders except those on the exclude-dirs exclusion list.
    $ yandex-disk sync [OPTION]
  • publish: Get a public link to the specified file or folder (FILE).
    $ yandex-disk publish [OPTION] FILE
  • unpublish: Unpublish the specified file or folder (FILE).
    $ yandex-disk unpublish FILE

Additional options [OPTION]

--config=FILE, -c FILE

Show the configuration file. The config.cfg file is used by default in ~/.config/yandex-disk.

--dir=DIR, -d DIR

Enter the folder where the local copy of Yandex.Disk will be stored. If a name was not entered during the initial setup, ~/Yandex.Disk will be used by default.

--auth=FILE, -a FILE

Enter the file containing authorization data. The default file is passwd, which was created using the token command or the setup wizard and is stored in ~/.config/yandex-disk.

--exclude-dirs=DIR1,DIR2,...

Do not sync the specified directories. For these settings to always apply, these directories must be added to the exclude-dirs exclusion list in the config.cfg file. For settings to work correctly, the names of excluded directories should be separated with commas, not spaces.

--read-only

Forbid changing files on the Yandex.Disk server and only sync local copies. In the event of syncing conflicts, local files are renamed. If the --overwrite setting is also enabled, local files are overwritten.

--overwrite

Let changes made to the local copy of Yandex.Disk be overwritten when syncing with the server. Used together with the --read-only option.

--no-daemon, -D

Launch the daemon without returning management to the console. To return management, the daemon must be stopped by launching the command yandex-disk stop in another console or by closing the current console.

--help, -h

Display help.

--proxy=PARAM

Configure a proxy server. Valid parameters:

  • auto: Use system proxy settings (used by default).
  • no: Do not use a proxy server.
  • protocol,address,port,login,password: Manually set up the server.

Examples of using commands

$ yandex-disk start -c ~/ydconfig/newconfig.cfg # launch the daemon and sync with specified configuration file 
$ yandex-disk start --exclude-dirs=Foto # do not sync folder 'Photo'
$ yandex-disk sync --read-only # sync folders in 'read-only' mode
$ yandex-disk publish Foto # get a public link to the folder 'Photo'