<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>nextcloud &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/nextcloud/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 11 Apr 2023 15:59:41 +0000</lastBuildDate>
	<language>en-GB</language>
	<copyright>© Terence Eden. 🄯 CC BY-SA. See https://shkspr.mobi/blog/copyright-and-copyleft/</copyright>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>nextcloud &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[NextCloud Client Command Line]]></title>
		<link>https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/</link>
					<comments>https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#comments</comments>
				<dc:creator><![CDATA[Terence Eden]]></dc:creator>
		<pubDate>Thu, 13 Apr 2023 11:34:11 +0000</pubDate>
		<category><![CDATA[HowTo]]></category><category><![CDATA[linux]]></category><category><![CDATA[nextcloud]]></category>		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=45487</guid>

					<description><![CDATA[I have a headless server - one without a GUI - which I use as a NextCloud client. My laptop, phone, tablet, and server all sync with a cloud-based NextCloud instance.  But, sadly, NextCloud don&#039;t offer a way for servers to speak to servers. If you try to run apt install nextcloud it will try to install 300MB of GUI dependencies which you just can&#039;t use.  Luckily, there&#039;s a way around all that!…]]></description>
										<content:encoded>&lt;p&gt;I have a headless server - one without a GUI - which I use as a NextCloud client. My laptop, phone, tablet, &lt;em&gt;and&lt;/em&gt; server all sync with a cloud-based NextCloud instance.&lt;/p&gt;

&lt;p&gt;But, sadly, &lt;a href="https://github.com/nextcloud/desktop/issues/1203"&gt;NextCloud don't offer a way for servers to speak to servers&lt;/a&gt;. If you try to run &lt;code&gt;apt install nextcloud&lt;/code&gt; it will try to install 300MB of GUI dependencies which you just can't use.&lt;/p&gt;

&lt;p&gt;Luckily, there's a way around all that! It's a bit convoluted, so here's a guide.&lt;/p&gt;

&lt;h2 id="download-the-latest-appimage"&gt;&lt;a href="https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#download-the-latest-appimage"&gt;Download the latest AppImage&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Grab the link for &lt;a href="https://github.com/nextcloud/desktop/releases/latest/"&gt;the most recent AppImage&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On your server:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-_"&gt;mkdir nextcloudapp
cd nextcloudapp
wget https://github.com/nextcloud/desktop/releases/download/????.AppImage -O Nextcloud.AppImage
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Make it executable:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-_"&gt;chmod +x Nextcloud.AppImage
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Next, extract it:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-_"&gt;./Nextcloud.AppImage --appimage-extract
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That will place all the files in &lt;code&gt;squashfs-root/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I moved all the files and folders out of there to a more convenient location.&lt;/p&gt;

&lt;p&gt;You may need to install some dependencies:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-_"&gt;sudo apt install libgl1 libharfbuzz0b
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Finally, you need to export the libraries which were in the app image:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-_"&gt;export LD_LIBRARY_PATH=~/nextcloudapp/usr/lib
&lt;/code&gt;&lt;/pre&gt;

&lt;h2 id="running-it"&gt;&lt;a href="https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#running-it"&gt;Running it&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;I recommend creating an app specific password on your NextCloud admin interface.&lt;/p&gt;

&lt;p&gt;You can run NextCloud as a one-off job using:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-_"&gt;./nextcloudcmd -u "MyUserName" -p "P4ssw0rd" /path/to/NextCloud/ https://your_online.nextcloud.example/
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;That will spit out a &lt;em&gt;lot&lt;/em&gt; of log files. You can make it run silently with the &lt;code&gt;-s&lt;/code&gt; option. Probably best to run it in a &lt;code&gt;tmux&lt;/code&gt;.&lt;/p&gt;

&lt;h2 id="make-it-persistent"&gt;&lt;a href="https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#make-it-persistent"&gt;Make it persistent&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;Sadly, there's no way to &lt;a href="https://help.ubuntu.com/community/EnvironmentVariables#File-location_related_variables"&gt;permanently set the LD_LIBRARY_PATH&lt;/a&gt;. So you'll need to export the library each time you want to sync.&lt;/p&gt;

&lt;p&gt;If only NextCloud offered a headless daemon. Ah well!&lt;/p&gt;

&lt;h2 id="bugs"&gt;&lt;a href="https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/#bugs"&gt;Bugs&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;There is a bug with the CLI version where it &lt;a href="https://github.com/nextcloud/desktop/issues/5591"&gt;won't download files with a colon in the filename&lt;/a&gt;.&lt;/p&gt;
&lt;img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=45487&amp;amp;HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager"&gt;</content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/04/nextcloud-client-command-line/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
