FreeFileSync auto back up with Anacron on Ubuntu

Discuss new features and functions
Posts: 1
Joined: 18 May 2021

Paul5678

Hi,Just looking to post some info for others who may encounter the same issues I have. After weeks of searching and struggling to get FFS to work via anacron on Unbuntu 20.04 I would like to post the anacron code that has finally worked for me. So below is the code that should go in the anacrontab to run a back up based on the .FFS_batch file once per day, for a standard out of the box install of FreeFileSync on an out of the box install of ubuntu 20.04.
1       1     ffsbackup     sudo -u yourusername DISPLAY=:0 /usr/local/bin/FreeFileSync /home/yourusername/yourbackupname.ffs_batch
This code allows the FFS_batch file to run as the user which overcomes all sorts of issues with displays and naming conventions. There may be other, possibly better solutions but this is simple and effective and the only one which has worked for me.(replace "yourusername" with your actual user name and "yourbackupname.ffs_batch" with the name of the batchfile you want to run of course, and use correct paths if different from above). Good luck and happy to help if I can.
Posts: 1
Joined: 1 Jun 2021

Josema

Hi Paul,

I tried to put inside cron.daily (without .sh extension) and it should work, forcing the
/var/spool/anacron date to the past, but no... using the anacron -d -n -f -s make the backup visible, but it is not the desired behaviour, it might appear automatically.

I must to say that the user crontab worked fine, but it's a desktop computer so it spends much time powered off.

Eventually, using your solution (and changing my paths) was the successful one.

Thanks for sharing dude!