4 if (! -d "bin" || ! -d "SL") {
5 print("This tool must be run from the kivitendo ERP base directory.\n");
9 unshift @INC, "modules/override"; # Use our own versions of various modules (e.g. YAML).
10 push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version.
17 use English '-no_match_vars';
18 use POSIX qw(setuid setgid);
32 use SL::InstanceConfiguration;
42 'client=s' => \ my $client,
45 $options->{client} = $client;
50 SL::LxOfficeConf->read;
52 my $client = $config{client} || $::lx_office_conf{devel}{client};
55 error("No client found in config. Please provide a client:");
59 $::lxdebug = LXDebug->new();
60 $::locale = Locale->new("de");
62 $::auth = SL::Auth->new();
64 if (!$::auth->set_client($client)) {
65 error("No client with ID or name '$client' found in config. Please provide a client:");
68 $::instance_conf = SL::InstanceConfiguration->new;
69 $::instance_conf->init;
73 print STDERR colored(shift, 'red'), $/;
77 print STDERR "scripts/sync_files_from_backend.pl --client name-or-id\n" ;
84 SL::File->sync_from_backend( file_type => 'document');
85 SL::File->sync_from_backend( file_type => 'attachment');
86 SL::File->sync_from_backend( file_type => 'image');