Reputation: 46208
I'm using gedit with Ubuntu to edit files through FTP.
I have bookmarked a FTP connection with the Ubuntu integrated functionnality (Connect to Server)
I can use it to edit files with gedit, but I didn't find a way to set any timeout or keep alive option.
So I have to refresh a Nautilus page on my bookmark to awake the connection each time.
What can I do ?
Upvotes: 2
Views: 3444
Reputation: 4794
I prefer using crontab(my computer not in the server...), works on Ubuntu 22.04.4 and GNOME nautilus 42.6
this works only when there is one o more connections
example:
* * * * * myuser ls /run/user/1000/gvfs/sftp* &>/dev/null
Upvotes: 0
Reputation: 474
#!/bin/bash
while true
do
#10.10 and earlier
ls /run/user/$UID/gvfs/ftp* &> /dev/null
#for SFTP
ls /run/user/$UID/gvfs/sftp* &> /dev/null
#11.04+
ls /run/user/$UID/gvfs/FTP* &> /dev/null
#for SFTP
ls /run/user/$UID/gvfs/SFTP* &> /dev/null
sleep 15
done
Upvotes: 0
Reputation: 451
The following code has worked wonders for gedit-ing via nautilus ftp for ubuntu 13.04 and ubuntu 14.04 (originally from here and here)
edit:
/etc/sysctl.conf
add these lines:
net.ipv4.tcp_keepalive_time = 60
net.ipv4.tcp_keepalive_intvl = 5
net.ipv4.tcp_keepalive_probes = 6
save and reboot system.
Upvotes: 1
Reputation: 81
Using FileZilla is ok for a one-time transfer. The problem is that once you get used to how easy it is to edit files over a mounted network connection, applications like FileZilla are not an option. In fact, it would probably double or triple the time it takes to jump on a server and edit a quick file.
You are correct in saying there is no keep alive option in the gvfsd-ftp package. At least not one I can find. I did however find a simple bash script that would help out.
#!/bin/bash
while true
do
ls ~/.gvfs/ftp* &> /dev/null
sleep 15
done
No credit for me. I found this posted at launchpad
Just run it at startup. On ubuntu you can just chmod a+x and run it as a startup app. Since there is a sleep timer, obviously you wouldn't want to run it multiple times in cron.
Upvotes: 5
Reputation: 1322
You probably need to write a custom Nautilus cript. Check this SourceForge page.
Alternatively, you could use FileZilla and set gedit as the default editor. When FileZilla detect that you have saved a file, it will automatically update the FTP server.
Upvotes: 0