6 if (! -d "bin" || ! -d "SL") {
7 print("This tool must be run from the kivitendo ERP base directory.\n");
11 unshift @INC, $FindBin::Bin . '/../modules/override'; # Use our own versions of various modules (e.g. YAML).
12 push @INC, $FindBin::Bin . '/..';
19 use English '-no_match_vars';
20 use POSIX qw(setuid setgid);
34 use SL::InstanceConfiguration;
44 'client=s' => \ my $client,
47 $options->{client} = $client;
52 SL::LxOfficeConf->read;
54 my $client = $config{client} || $::lx_office_conf{devel}{client};
57 error("No client found in config. Please provide a client:");
61 $::lxdebug = LXDebug->new();
62 $::locale = Locale->new("de");
64 $::auth = SL::Auth->new();
66 if (!$::auth->set_client($client)) {
67 error("No client with ID or name '$client' found in config. Please provide a client:");
70 $::instance_conf = SL::InstanceConfiguration->new;
71 $::instance_conf->init;
75 print STDERR colored(shift, 'red'), $/;
79 print STDERR "scripts/sync_files_from_backend.pl --client name-or-id\n" ;
86 SL::File->sync_from_backend( file_type => 'document');
87 SL::File->sync_from_backend( file_type => 'attachment');
88 SL::File->sync_from_backend( file_type => 'image');