NextcloudCMD without GUI

We will install and configure the Nextcloudcmd withou any GUI to sync all your data to a Nextcloud Server silently. Therefore we will add the Nextcloud repository as root to our Ubuntu Server, install the Nextcloud client, create a shell script and configure a cronjob to sync your data automatically:

sudo -s
add-apt-repository ppa:nextcloud-devs/client

Then we run “apt update” and instal the Nextcloud Client:

apt update && apt install nextcloud-client

Create a shell script to sync your data:

vi /root/

Paste the following rows:

echo "-------------------------------------"
echo "START: $(date)"
echo "-------------------------------------"
nextcloudcmd -v
echo "-------------------------------------"
echo "/NextcloudCMD by C-RIEGER.DE..."
nextcloudcmd -u "YourUser" -p "Your-APP-Pass-Word" -s /your/local/path/
echo "-------------------------------------"
echo "END: $(date)"
echo "-------------------------------------"
mail -s "NextcloudCMD" -a "From: Your Name <>"< /home/ubuntuuser/bkup/nccmd.txt
exit 0

Substitute all the red ones properly. Save and quit the file (:wq!) and make the script executable:

chmod +x /root/

Create a cronjob to sync your data @hourly:

crontab -e

Paste the following row:

@hourly /root/ > /home/ubuntuuser/bkup/nccmd.txt 2>&1

Verify, if the sync is working well by running:

/root/ > /home/ubuntuuser/bkup/nccmd.txt 2>&1

You should receive an email that looks like:

START: Do 17. Aug 08:02:03 CEST 2017
nextcloudcmd version 2.3.2
/NextcloudCMD by C-RIEGER.DE…
END: Do 17. Aug 08:02:07 CEST 2017

From now, all your data will be synced hourly.

Carsten Rieger