Commands and parameters

Commands

Use the following commands to work with the client:

  • token: Get an authorization key (OAuth token) for your Yandex username.
    When entering the command, you can specify the file name for the token and the path to it (FILE). If no additional options are specified, the file passwd will be created in the directory ~/.config/yandex-disk to store the token.

    $ yandex-disk token [FILE]
    

    You don't need to enter your username and password in the client. After calling the command, Yandex Disk will ask you to open a certain page in the browser and enter your unique code there.

    Note

    Before entering the code, make sure you are logged in to the browser under the correct account.

  • start — launch daemon and sync all folders except those on the exclusion list exclude-dirs.

    $ 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 exclusion list exclude-dirs.

    $ 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 configuration file. The file config.cfg is used by default in the directory ~/.config/yandex-disk.

--dir=DIR, -d DIR

Enter the folder where the local copy of Yandex Disk will be stored. If the name was not entered when running setup, the catalog ~/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 command token or the setup wizard and is stored in the directory ~/.config/yandex-disk.

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

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

--read-only

Forbid changing files on the Disk server and run sync only in a local copy. In case of conflicts when syncing, local files will be renamed. If the --overwrite setting is also enabled, local files will be overwritten.

--overwrite

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

--no-daemon, -D

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

If this option is used, the app doesn't read the configuration file. You'll need to enter all the necessary settings in the command line. The option exclude-dirs corresponds to the argument --exclude-dirs.

$ yandex-disk --no-daemon --dir=/root/Yandex.Disk --exclude-dirs=DO_NOT_SYNC,temp

Note

When using --no-daemon, you don't need to specify the start command: in this mode, all commands are ignored.

--help, -h

Display help.

--proxy=PARAM

Set proxy server. Valid parameters:

  • Auto: use system proxy settings (used by default)
  • No — Do not use a proxy server.
  • protocol,address,port,login,password — set manually.

Examples of using commands

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