nextcloudcmd
Synchronize files with a Nextcloud server
SYNOPSIS
nextcloudcmd [options] local_folder nextcloud_url
PARAMETERS
local_folder
The local directory to synchronize with the Nextcloud server.
nextcloud_url
The URL of the Nextcloud server, including the remote.php/dav/files/USERNAME path.
--trust
Trust the server certificate, even if it's self-signed.
--user username
The Nextcloud username for authentication.
--password password
The Nextcloud password for authentication. Use with caution as it exposes the password on the command line.
--non-interactive
Do not prompt for user interaction.
--version
Show the version of the command-line client
--help
Display a help message.
DESCRIPTION
The nextcloudcmd command is a command-line client for interacting with a Nextcloud server. It allows users to synchronize files between a local directory and a Nextcloud instance, offering an alternative to the graphical Nextcloud desktop client. It supports features like uploading, downloading, synchronizing, and conflict resolution from the terminal. This is especially useful in headless environments, for scripting automated backups, or for users who prefer a command-line interface.
nextcloudcmd relies on libocsync for performing synchronisation and is based on the same code used by the Nextcloud Desktop Client. This ensures compatibility and reliable data transfer.
It allows you to automate tasks like uploading files to a server, checking the server for new versions, or resolving conflicts in an automated manner. This makes it a powerful tool for users who want to manage their Nextcloud files from the command line.
CAVEATS
Storing passwords directly in scripts is a security risk. Consider using environment variables or a secure credential management system. The remote URL must point to the correct webdav directory. Synchronization depends on having the WebDAV interface correctly setup on the Nextcloud server.
AUTHENTICATION
nextcloudcmd supports basic authentication. For more secure authentication methods, consider using a .netrc file or other credential management solutions. Avoid storing passwords directly in scripts. The --non-interactive flag may be necessary for automated setups where user prompts are not desired.
TROUBLESHOOTING
Common issues include incorrect Nextcloud URLs, authentication failures, and certificate errors. Ensure the URL points to the correct remote.php/dav/files/USERNAME path. Use the --trust flag to bypass certificate validation for self-signed certificates. Check Nextcloud server logs for authentication issues. Ensure the local folder has the correct permissions for reading and writing. When facing synchronization problems verify folder permissions are correct on the server.
HISTORY
nextcloudcmd was developed alongside the Nextcloud desktop client as a command-line alternative. It allows users to have command-line access and synchronisation ability to Nextcloud servers. It is based on the same code used by the desktop client.
SEE ALSO
ocsync(1), mount.davfs(8)