Oneshowback in cron

Hello.

I’m trying to set the oneshowback command in crontab but it seems the help page is not entirely correct about the syntax.
oneshowback suggests to use --user and --password as options but as soon as i try to use that options i get:

one # oneshowback calculate --user oneadmin --password nicepassword --start "09/2016"
invalid option: --user

Any suggestions?

thanks and cheers
t.

According to docs

http://docs.opennebula.org/5.0/operation/users_groups_management/showback.html#calculate-monthly-reports

--user and --password options are just for getting showbacks, but not for calculating. Calculate have just --start and --end options

so you should switch to oneadmin user and edit crontab

sudo su - oneadmin
crontab -e

add line like this and save

@monthly oneshowback calculate --start $(date --date='-1 month' +'%m/%Y')

Thats all

Thanks Kristian. Will try that.

cheers
t.

Hello @feldsam
I am exploring Cron job, scheduler and OneShowback.
My end goal is to retrieve VM creation date/start date and run a job everyday and perform some actions daily.
It seems to be quite similar to Oneshowback apart from costing.
Could someone from @team could help on the same.

Thanks in advance!!