whenever add \ in front of %
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 8.9k
- Forks
- 715
- PR merge metrics
- No merged PRs in 30d
Description
It's from this line: https://github.com/javan/whenever/blob/master/lib/whenever/job.rb#L22
I would like to set :output to look like this set :output, "#{log_folder}/whenever_cron_$(date +\"%F__%T\").log"
After the deployment, I look at crontab -l. the full command looks like this:
/bin/bash -l -c 'cd /mnt/ebs/utilities/releases/20150514202232 && mkdir -p /mnt/ebs/logs/utilities/log_manager && bundle exec ruby lib/log_manager/log_manager.rb >> /mnt/ebs/logs/utilities/log_manager/whenever_cron_$(date +"\%F__\%T").log 2>&1'
It adds \ in front of %. How can I avoid this?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at lib/whenever/job.rb line 22 and trace how the output is escaped before it is written to crontab. Reproduce the reported set :output case, then verify that the generated command preserves the intended date format without adding unwanted backslashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash, ruby
- Domain
- devops
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100