FreeFileSync doesnt start without active term

Get help for specific problems
Posts: 2
Joined: 5 Apr 2012

vittoriomassimo

Hi
I use and love FFS. I try to automate a file syncronization on an UBUNTU 11.10
:
in root-user crontab i put the line:


...
01 1 * * 1-6 /usr/bin/FreeFileSync /root/DATI-01.ffs_batch
...


The configuratrion file (DATI-01.ffs_batch) is:

<?xml version="1.0" encoding="UTF-8"?>
    <FreeFileSync XmlType="BATCH">
        <MainConfig>
            <Comparison>
                <Variant>ByTimeAndSize</Variant>
                <HandleSymlinks>Ignore</HandleSymlinks>
            </Comparison>
            <SyncConfig>
                <Variant>Custom</Variant>
                <CustomDirections>
                    <LeftOnly>right</LeftOnly>
                    <RightOnly>none</RightOnly>
                    <LeftNewer>right</LeftNewer>
                    <RightNewer>none</RightNewer>
                    <Different>none</Different>
                    <Conflict>none</Conflict>
                </CustomDirections>
                <DeletionPolicy>MoveToCustomDirectory</DeletionPolicy>
                <CustomDeletionFolder>/var/space/versioni</CustomDeletionFolder>
            </SyncConfig>
            <GlobalFilter>
                <Include>*</Include>
                <Exclude>/.Trash-*/&#x0A;/.recycle/</Exclude>
                <TimeSpan>0</TimeSpan>
                <UnitTimeSpan>Inactive</UnitTimeSpan>
                <SizeMin>0</SizeMin>
                <UnitSizeMin>Inactive</UnitSizeMin>
                <SizeMax>0</SizeMax>
                <UnitSizeMax>Inactive</UnitSizeMax>
            </GlobalFilter>
            <FolderPairs>
                <Pair>
                    <Left>/var/SERVER/Ex-disco-E</Left>
                    <Right>/var/space/copie/DATI/Ex-disco-E</Right>
                    <LocalFilter>
                        <Include>*</Include>
                        <Exclude/>
                        <TimeSpan>0</TimeSpan>
                        <UnitTimeSpan>Inactive</UnitTimeSpan>
                        <SizeMin>0</SizeMin>
                        <UnitSizeMin>Inactive</UnitSizeMin>
                        <SizeMax>0</SizeMax>
                        <UnitSizeMax>Inactive</UnitSizeMax>
                    </LocalFilter>
                </Pair>
            </FolderPairs>
            <ExecuteWhenFinished/>
        </MainConfig>
        <BatchConfig>
            <Silent>true</Silent>
            <ShowProgress>false</ShowProgress>
            <LogfileDirectory>/var/log/FreeFileSync </LogfileDirectory>
            <LogfileCountMax>365</LogfileCountMax>
            <HandleError>Ignore</HandleError>
        </BatchConfig>
    </FreeFileSync>


now: if ilaunch the command line :


...
/usr/bin/FreeFileSync /root/DATI-01.ffs_batch
...


from a terminal (putty) it starts perfectly working, BUT
the night job doesn't do anithing...
someone can help me?
User avatar
Site Admin
Posts: 7280
Joined: 9 Dec 2007

Zenju

It's unlikely this problem has to do with FFS in particular. Maybe a few
general hints about why cron won't start help here:
http://askubuntu.com/questions/23009/reasons-why-crontab-does-not-work
Posts: 2
Joined: 5 Apr 2012

vittoriomassimo

Hi,
from the logs nothing that help me , BUT adding a redirection on stderr



/usr/bin/FreeFileSync /root/DATI-01.ffs_batch 2>/tmp/scriptlog.txt


i found in /tmp/scriptlog.txt :



Error: Unable to initialize gtk, is DISPLAY set properly?



It seems that the problem is that FreeFileSync try to open a graphical
window...
how can i say to FreeFileSync to do everything without a graphic shell ?

Can you help me ?
Thanks in advance
User avatar
Site Admin
Posts: 7280
Joined: 9 Dec 2007

Zenju

I fear running FFS without GTK is not possible.
User avatar
Site Admin
Posts: 7280
Joined: 9 Dec 2007

Zenju

Maybe you could use a different task scheduler which starts at a later stage
when GUI is available.
Posts: 2
Joined: 18 Oct 2010

bigzdog

Found a way around this to help others who may have this issue.

I used the below cron job and it is working.

/usr/bin/FreeFileSync /root/DATI-01.ffs_batch --display=:0.0

http://promberger.info/linux/2009/01/02/running-x-apps-like-zenity-from-crontab-solving-cannot-open-display-problem/

EDIT:
The above worked on Ubuntu 10.04. Just upgraded to 12.04 and there is new security on it.

You must run "xhost +local:" from the session you want to run the display on. Xubuntu has the auto start program which is what I used for that.
Posts: 1
Joined: 18 Jun 2012

denywinarto

Found a way around this to help others who may have this issue.

I used the below cron job and it is working.

/usr/bin/FreeFileSync /root/DATI-01.ffs_batch --display=:0.0

http://promberger.info/linux/2009/01/02/running-x-apps-like-zenity-from-crontab-solving-cannot-open-display-problem/

EDIT:
The above worked on Ubuntu 10.04. Just upgraded to 12.04 and there is new security on it.

You must run "xhost +local:" from the session you want to run the display on. Xubuntu has the auto start program which is what I used for that.bigzdog
Hi, could you explain what you meant by this?

You must run "xhost +local:" from the session you want to run the display on. Xubuntu has the auto start program which is what I used for that.

Im still new at ubuntu, what exactly do i have to do?
Thanks