New to Linux

Get help for specific problems
Posts: 4
Joined: 12 Aug 2020

alex4orly

Just moved from Windows, installed Ubuntu 20.04 and want to use this backup system.
Downloaded the tar.gz file but have no idea on how to install the app...

Need some instructions please.
I found some posts with make install... How? I hope there is a way I can just unpack it and run something like:

sudo apt-get install xxxx

Or am I dreaming?

Thanks
Posts: 306
Joined: 7 Jan 2018

bgstack15

You ask very good questions. Different Linux distributions (Ubuntu, Red Hat Enterprise Linux, Linux Mint, etc.) can use different package formats. If you download a source tarball (.tar.gz or .tar.bz2 or similar) you normally have to run a ./configure && make && make install. But the release of FreeFileSync for Linux is already compiled.

So, to use the official release of FreeFileSync for Linux on Ubuntu, you need to extract the tarball. You can either use some graphical program (I forget what vanilla Ubuntu will use, but xarchiver would be one tool that could do it) usually by just double-clicking the downloaded tarball file, or use a terminal:
cd ~/Downloads
tar zxvf FreeFileSync_11.0_Linux.tar.gz
Where tilde ~ is normally expanded by the shell to mean /home/alex4orly or wherever your $HOME directory is.
Now the binary to execute will be located at ~/Downloads/FreeFileSync/FreeFileSync. Technically this is a small wrapper program that determines the architecture of your computer (i.e., x86_64 or i686) and then calls Bin/FreeFileSync_i686 or Bin/FreeFileSync_x86_64.
To set up an icon for this program for the menu, you can set up a file as either ~/.local/share/applications/FreeFileSync.desktop or for all users at /usr/share/application/FreeFileSync.desktop.
You can use the provided FreeFileSync.desktop (might show up in your file manager as just "FreeFileSync" [Desktop configuration file]) as a template. But the file should have contents similar to:
[Desktop Entry]
Type=Application
Name=FreeFileSync
GenericName=Folder Comparison and Synchronization
GenericName[de_DE]=Ordnervergleich und Synchronisation
Exec=/home/alex4orly/Downloads/FreeFileSync/FreeFileSync %F
Icon=/home/alex4orly/Downloads/FreeFileSync/Resources/FreeFileSync.png
NoDisplay=false
Terminal=false
Categories=Utility;FileTools;
StartupNotify=true
You can of course move this FreeFileSync directory to somewhere else if you like; just remember to update the .desktop file that you deployed to the applications/ directory which is used by the menu system!

There might be places out there that offer FreeFileSync as a .deb (dpkg) for the easy apt-get operations. I bundle it for myself in .deb format for Devuan Ceres but I haven't tested it on Ubuntu. If you want to play around with it: link. But please realize that it is unofficial, and just a random dude (me) building it for himself.
Posts: 4
Joined: 12 Aug 2020

alex4orly

Hello,

OK, I managed to install it and tried a manual action.
My question is : Is it possible to setup a schedule (Yes, I am happy to make a donation).
The schedule, I mean - once a day at a set time, or something like that

Thanks
Alex
Posts: 306
Joined: 7 Jan 2018

bgstack15

How one runs automatic tasks in Linux is to use cron. Search this forum for linux cron to discover all the information about this topic.
In general, you probably need to set up an entry that looks like:
# filename: /etc/cron.d/90_freefilesync.cron
30 2 * * * alex4orly env DISPLAY=:0 /home/alex4orly/Downloads/FreeFileSync/FreeFileSync /home/alex4orly/Documents/myfolders.ffs_batch 1>/dev/null 2>&1
You will need root access to set up a file in /etc/cron.d. So you can use a terminal, run "sudo su -" or "sudo -i", and then run "nano /etc/cron.d/90_freefilesync.cron" or vi <filename>. Or if you know your user has access to run its own crontab, you can just run crontab -e and edit the provided file:
30 2 * * * env DISPLAY=:0 /home/alex4orly/Downloads/FreeFileSync/FreeFileSync /home/alex4orly/Documents/myfolders.ffs_batch 1>/dev/null 2>&1
The only difference here is your own crontab is that you do not have to state what user will own the process.
Cron uses an obtuse way of describing the times to run. You can research this online on your own, but my example here is "run at 2:30 [AM] every day, every month, on every day of the week."
The DISPLAY=:0 is required because FreeFileSync is a graphical program and it needs to know what X session to use. :0 is the main session used by a user who logs in at the main screen. If you ever start remote session using Xvnc or xrdp, that could be :1 or :10 or some other value but that's not what we need.
Posts: 4
Joined: 12 Aug 2020

alex4orly

Thanks for the detailed feedback, but:

1) I am new to Linux, after 30 years in Windows
2) I have no idea what is cron, nor any exprience in writing scripts
3) I am the only user who logs into this computer
4) When I get into Terminal, the prompt I see is this : alex@alex-NUC8i7HNK:~$
5) my computer name is alex, this is my name. My computer is : NUC8i7HNK

So, maybe, you can be so kind and show me an explicit script for this case. Your example of one a day, every day at 2:00PM is perfect. Please include instructions on what should the file name / script be, where to put it into.

Can this run in the background? I don't need to see it running.

Thanks again
Alex
Posts: 306
Joined: 7 Jan 2018

bgstack15

I have actually never tried to run FreeFileSync invisibly. By setting DISPLAY to a value, it would be able to make itself visible if it wanted to. I think running FreeFileSync with a .ffs_batch file will make it run invisibly, but it definitely must have the DISPLAY value set to something.

The file to place is that: /etc/cron.d/90_freefilesync.cron
Any file in the /etc/cron.d/ directory will be interpreted by your cron daemon. Linux uses forward slashes / instead of the Windows backslash \ method to separate directories when listing a file path.
Everything is run by a user on a Linux system. That user could be one of a dozen of system accounts, or your user account. If you set up file in /etc/cron.d, you have to specify what user will run the process. Let's stick to this method.
So, you need to set up a new file in /etc/cron.d.
In a terminal, you would enter:
sudo -i
Which will take you to a root shell (running /bin/bash as root user, so not your own user). You could use any number of ways to get to a root shell, such as sudo su - or sudo su root.
So once at the root shell, you will run:
cd /etc/cron.d
This will change directory to /etc/cron.d, which is where the cron daemon looks for files to interpret.
We need to set up a new file for it:
nano 90_freefilesync.cron
This will open the nano editor which is good for beginners, and it will open up a new file named 90_freefilesync.cron.
Enter in this line:
0 14 * * * alex env DISPLAY=:0 /home/alex/Downloads/FreeFileSync/FreeFileSync /home/alex/Documents/sync.ffs_batch 1>/dev/null 2>&1
And then select the buttons (described at the bottom of the terminal screen) for saving and then exiting. The carat ^ symbol is short for CTRL.
You will need to adjust the path here to wherever it is you have put the FreeFileSync binary. And the 1 and 2 things just suppress some email stuff that is beyond the scope of this conversation.
The numbers in this example are 0 for the minute 0 of the hour, and 14 is the 14th hour of the day, so 2pm, and the asterisks are for every day of the month, every month, and every day of the week. The "alex" is your user. And the path to sync.ffs_batch should actually be the path to whatever sync batch file you have set up and saved somewhere.
Posts: 4
Joined: 12 Aug 2020

alex4orly

What a fantastic tutorial, thanks again
Just one thing unclear : /home/alex/Downloads/FreeFileSync/FreeFileSync

Waht is my Downloads folder doing here? FreeFileSync is already installed
What is the FReeFileSync binary? I didn't do any adjustments during installation, I am on Ubuntu 20.04 - so, what should I use instead of the Doanloads folder?

Many thanks
Alex
Posts: 306
Joined: 7 Jan 2018

bgstack15

The FreeFileSync binary is the binary file (that is, file with binary [machine] code that the computer can run). For the official release of FreeFileSync, you can use either the FreeFileSync binary or the one it actually calls, the Bin/FreeFileSync_x86_64.
I was just using an example path where I guessed you extracted that tarball (the .tar.gz file, which is analogous to a zip file). Wherever the FreeFileSync executable file is, is where you need to set the path to.
The .desktop file is basically just a shortcut; "installing" is not something a person does with a release of software like this. You just place the files somewhere (well, that is what "installing" is...) and then you can make a shortcut for the menu system to use. The presence or absence of a .desktop file anywhere has no effect on the path of the binary file itself.