incron error log?

ghostadmin

Grand Admiral Special
Mitglied seit
11.11.2001
Beiträge
25.179
Renomée
184
Standort
Dahoam Studios
ich habe folgendes als Datei in incron:
/home/scan/brother IN_CREATE su -c "/usr/bin/scp $@/$# trechber@hypervisor:/data1/filer/Scan" trechber

sehe auch das incron gestartet wird:
Apr 6 16:02:25 web incrond[1227]: (system::watch_scan) CMD (su -c "/usr/bin/scp /home/scan/brother/Scan_004767.pdf trechber@hypervisor:/data1/filer/Scan" trechber)

Jedoch ist von der Datei auf dem Zielsystem nichts zu sehen. Wenn ich den Befehl manuell ausführe dann funktioniert das kopieren aber. Woran kann das liegen? Gibts da kein Log?

Es geht auch wenn ich ein bash script anlege und über incron ausführen lasse. Wenn der Befehl im incron Script steht, dann nicht.
 
Hallo

Liegt es vielleicht an den Berechtigungen oder Gruppenzugehörigkeiten ?

incrond uses two categories of tables incrontab(5). System tables are usually located in /etc/incron.d and are maintained outside of incron (e.g. by various applications). These tables work on root rights level and thus any file may be watched and commands are executed with root privileges.

User tables are located in /var/spool/incron by default and have names based on user accounts. These tables use users' access rights, thus only files which the user may access are watched. Commands are executed with users' privileges.

If a table (incrontab) is changed incrond reacts immediately and reloads the table. Currently running child processes (commands) are not affected.

There are two files determining whether an user is allowed to use incron. These files have very simple syntax - one user name per line. If /etc/incron.allow exists the user must be noted there to be allowed to use incron. Otherwise if /etc/incron.deny exists the user must not be noted there to use incron. If none of these files exists there is no other restriction whether anybody may use incron. Location of these files can be changed in the configuration.

https://linux.die.net/man/8/incrond

MfG
RedBaron
 
Erfolgt denn ein Login via SSH/SCP (siehe auth.log) auf dem Zielsystem?

Grüße
Dalai
 
Dann wird der Befehl wohl nicht ausgeführt. Vermutung: su wird nicht gefunden, weil nicht im PATH für incron. Ich würde testweise entweder den kompletten Pfad zu su angeben oder im incron den PATH setzen (sofern das wie bei cron möglich ist). Kann man bei incron ebenfalls das Ende der Kommandos und deren Fehler protokollieren lassen? Bei cron geht das mit Startparameter -L, der je nach Initsystem irgendwo gesetzt werden muss, z.B. /etc/default/cron oder /etc/init/cron.conf.

Außerdem:
http://linux-aha.de/wordpress/2010/02/01/incron-ein-fileevent-basierter-cron/comment-page-1/ schrieb:
Aber ACHTUNG: Leider dürfen die Argumenten in der incrontab nur mit genau EINEM Leerzeichen getrennt sein, sonst funktioniert es nicht.

Grüße
Dalai
 
das mit dem path hatte ich noch gesehen, aber in der Eile vergessen das das auch auch den su zutrifft. Dann geht also insgesamt nur 1 Leerzeichen und nicht an mehreren Stellen.
 
Zurück
Oben Unten