Hi All!
I was trying to find anything about the topic and what I was able to dig out was Crontab definition for existing ffs_batch file in Ubuntu. What I need is to create a task on Ubuntu Server 20.04 LTS machine without gui to synchronize files between network share (Windows Server 2019, ActiveDirectory member) and Ubuntu Server 20.04 LTS without GUI, only CLI. I would need a manual how to:
1. Create a ffs_batch file from scratch with desired synchronization options and e-mail notification.
For this would also be good to "cache" somewhere logon name and password for Windows share (e.g. mount it using SAMBA). What is the best way?
2. Convert ffs_batch to ffs_real (if needed).
3. Create a task to start and run the task without user interaction as root when system starts, each 15 minutes.
Is it even possible without GUI? If not - which lightweight GUI should I pick to install on the server? To be honest, this is server and the best option would be to avoid the GUI.
Thank you very much in advance for help!
Ubuntu Server 20.04 LTS (no GUI!) and FFS task creation
- Posts: 8
- Joined: 19 Feb 2021
- Posts: 13
- Joined: 7 Mar 2021
freefilesync --help
.ffs_batch files are XML files you can edit with your favorite text editor. A sample is provided below.
Crontab Cheatsheet and Crontab Guru will provide plenty of examples to help you set your cron job.
I like to picture running anything as root as the equivalent of giving an evil-looking stranger the keys to your house with your left hand, along with a gallon of fuel and a book of matches to burn it down with the right hand. If you can, adjust your permissions and run as an unpriviliedged user instead ;)
It is also considered good practice to store your credentials as environment variables.
Good luck!
---
sample.ffs_batch
<?xml version="1.0" encoding="utf-8"?>
<FreeFileSync XmlType="BATCH" XmlFormat="17">
<Compare>
<Variant>TimeAndSize</Variant>
<Symlinks>Exclude</Symlinks>
<IgnoreTimeShift/>
</Compare>
<Synchronize>
<Variant>TwoWay</Variant>
<DetectMovedFiles>false</DetectMovedFiles>
<DeletionPolicy>RecycleBin</DeletionPolicy>
<VersioningFolder Style="Replace"/>
</Synchronize>
<Filter>
<Include>
<Item>*</Item>
</Include>
<Exclude>
<Item>*/.Trash-*/</Item>
<Item>*/.recycle/</Item>
</Exclude>
<TimeSpan Type="None">0</TimeSpan>
<SizeMin Unit="None">0</SizeMin>
<SizeMax Unit="None">0</SizeMax>
</Filter>
<FolderPairs>
<Pair>
<Left>/path/to/left/side/folder</Left>
<Right>/path/to/left/side/folder</Right>
</Pair>
</FolderPairs>
<Errors Ignore="true" Retry="0" Delay="5"/>
<PostSyncCommand Condition="Completion"/>
<LogFolder/>
<EmailNotification Condition="Always"/>
<Batch>
<ProgressDialog Minimized="true" AutoClose="true"/>
<ErrorDialog>Show</ErrorDialog>
<PostSyncAction>None</PostSyncAction>
</Batch>
</FreeFileSync>
- Posts: 8
- Joined: 19 Feb 2021
Hello,
Thank you very much! I will test it as soon as I have the oportuninty. Where can I find description of all FFS XML tags (options and available values with description)?
Thank you very much! I will test it as soon as I have the oportuninty. Where can I find description of all FFS XML tags (options and available values with description)?
- Posts: 13
- Joined: 7 Mar 2021
I left that as an exercise to you to find out :)
You might want to look at the program's source code or fire up FreeFileSync on your desktop and set the options you want and see how they are reflected the .ffs_batch file
You might want to look at the program's source code or fire up FreeFileSync on your desktop and set the options you want and see how they are reflected the .ffs_batch file
- Posts: 8
- Joined: 19 Feb 2021
Hello,
I used your advice and installed the solution on non-gui linux. What I've got is attached. I feel like this tool will not work without GUI. My question remains the same - will it work without GUI?
I looked at this thread: viewtopic.php?t=7838 but command
also gives the same result. Please help.
After I have enabled X11 forwarding in SSHD config and in SSH client I received the following error on command:
I used your advice and installed the solution on non-gui linux. What I've got is attached. I feel like this tool will not work without GUI. My question remains the same - will it work without GUI?
I looked at this thread: viewtopic.php?t=7838 but command
DISPLAY=:0 freefilesync --help
After I have enabled X11 forwarding in SSHD config and in SSH client I received the following error on command
freefilesync --help
---------------------------
TTSSH
---------------------------
The server attempted to forward a connection through this machine.
It requested a connection to the X server on localhost (display 0:0).
Connection refused (perhaps the service is not currently running)(code 10061).
The forwarded connection will be closed.
---------------------------
OK
---------------------------
- Attachments
-
- free-file-sync-error.png (3.43 KiB) Viewed 3689 times
- Posts: 309
- Joined: 7 Jan 2018
On your ssh session, you can make sure the DISPLAY variable was set for you by ssh.
Mine tends to look like "localhost:10.0".
It's possible the system running your ssh client is not running an X server, or you need to open the firewall? It looks like "TTSSH" is Tera Term which looks like a Windows program. I used to use Xming to run an X server suitable for X-forwarding in ssh.
echo $DISPLAY
It's possible the system running your ssh client is not running an X server, or you need to open the firewall? It looks like "TTSSH" is Tera Term which looks like a Windows program. I used to use Xming to run an X server suitable for X-forwarding in ssh.
- Posts: 8
- Joined: 19 Feb 2021
Hello,
Thank you @dynosire for a tip - I managed to overcome the topic during the weekend by using rsync and Samba shares.
Regarding FFS and CLI mode - I did not manage to use it. All the time FFS wanted the GUI from me so I have abandoned this tool in Ubuntu Server.
Thank you all for your help!
Thank you @dynosire for a tip - I managed to overcome the topic during the weekend by using rsync and Samba shares.
Regarding FFS and CLI mode - I did not manage to use it. All the time FFS wanted the GUI from me so I have abandoned this tool in Ubuntu Server.
Thank you all for your help!