简体   繁体   中英

Can we provide a logging directory for a project in Rundeck?

I have several projects with multiple cron jobs scheduled in each on a Linux machine configured with Rundeck. I wanted to know if there is a simpler logging configuration that could be added so that all logs belonging to crons of one project are available in a common directory.
For instance, project A contains 3 scheduled crons A1, A2 and A3. A possibility of logging in a common directory would be to do add the log location to the cron command individually

bash testA1.sh>/logs/A/logA1.log
bash testA2.sh>/logs/A/logA2.log
bash testA3.sh>/logs/A/logA3.log

I wanted to know if there is a configuration for the project level A where I could add the parent directory for logging as /logs/A I could then change the commands as

bash testA1.sh>logA1.log
bash testA2.sh>logA2.log
bash testA3.sh>logA3.log

Additionally, can the logging file be provided in the cron configuration without specifying >{log_file_name}.log in the command.

Using logging plugin you can do that.

For example, you can configure a log plugin (for example s3/minio plugin ) at project level (setting at project.properties file)-

project.plugin.ExecutionFileStorage.org.rundeck.amazon-s3.path=/common/path/logs/${job.project}/${job.execid}.log

As you see, you can use job/project context variables with your custom path/filenames.

Check the full configuration documentation.

Tip: you can use s3 log plugin with Minio locally without problems.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM