You are not logged in.
Pages: 1
So I want to execute this line every minute on my computer: "/usr/bin/gcalcli remind". When I'm executing it, a small red box with my closest appointments will appear.
I've tried using cron and systemd, but both are not executing the command. It doesn't spawn the red box once.
cron:
#( 26.09.16@14:43 )( dun@Arch64L ):~ sudo pacman -S cronie
[sudo] password for dun:
warning: cronie-1.5.1-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
Packages (1) cronie-1.5.1-1
Total Installed Size: 0.26 MiB
Net Upgrade Size: 0.00 MiB
:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring [##############################################] 100
(1/1) checking package integrity [##############################################] 100
(1/1) loading package files [##############################################] 100
(1/1) checking for file conflicts [##############################################] 100
(1/1) checking available disk space [##############################################] 100
:: Processing package changes...
(1/1) reinstalling cronie [##############################################] 100
#( 26.09.16@14:43 )( dun@Arch64L ):~ systemctl start cronie.service
#( 26.09.16@14:44 )( dun@Arch64L ):~ systemctl enable cronie.service
Created symlink /etc/systemd/system/multi-user.target.wants/cronie.service → /usr/lib/systemd/system/cronie.service.
#( 26.09.16@14:36 )( dun@Arch64L ):~ EDITOR=gedit crontab -e
Then I entered this line
*/1 * * * * /usr/bin/gcalcli remind
At the end: Does not run the command every minute. Doesn't even execute ones.
systemd:
#( 26.09.16@14:38 )( dun@Arch64L ):~ sudo gedit /etc/systemd/system/gcalcliremind.service
Entered this:
[Unit]
Description=GCalCLIRemindService
[Service]
Type=simple
ExecStart="/usr/bin/gcalcli remind"
#( 26.09.16@14:45 )( dun@Arch64L ):~ sudo gedit /etc/systemd/system/gcalcliremind.timer
Entered this:
[Unit]
Description=Runs GCalCLIRemindService every minute
[Timer]
OnBootSec=1min
OnUnitActiveSec=1min
Unit=gcalcliremind.service
[Install]
WantedBy=multi-user.target
Started and enabled the timer, but nothing happens either. What am I doing wrong?
Last edited by Dun (2016-10-03 14:53:33)
Offline
Offline
You're running the command as root.
Offline
You're running the command as root.
Sorry but I don't understand. What command am I running as root?
Offline
The gcalcli one. It's beening run as the root user.
Offline
With the systemd timer, yes, but it looks like the crontab for user 'dun'. But then cron would be completely disconnected from any X session, while $DISPLAY and the like are normally imported into the systemd manager for user services. So converting to user service and timer is probably good enough.
The ExecStart command line should not be quoted btw.
Offline
I uninstalled cron, because it didn't do anything. I've removed the mistakes in the systemd timer and tried it with them.
#( 27.09.16@11:38 )( dun@Arch64L ):~ sudo gedit /etc/systemd/system/gcalremind.timer
[b]gcalremind.timer[/b]
[Unit]
Description=Run GCalRemind
[Timer]
OnCalendar=*:0/1
#( 27.09.16@11:38 )( dun@Arch64L ):~ sudo gedit /etc/systemd/system/gcalremind.timer
[b]gcalremind.service[/b]
[Unit]
Description=GCalCLIRemindService
[Service]
Type=simple
ExecStart=/usr/bin/gcalcli remind
The problem now is, that I would have to authenticate with root, but I kinda don't want having my config-files in the root-folder. Is it possible to use systemd without root? I've never used sudo while starting and enabling the timer, so I don't really understand, why root does run it in the end.
Offline
Is it possible to use systemd without root?
Offline
Finally had time to work on this problem. The timer works now, running as a user service
Offline
Pages: 1