Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

run rake command without --silent #524

Closed
anthonydahanne opened this issue Jan 6, 2015 · 11 comments
Closed

run rake command without --silent #524

anthonydahanne opened this issue Jan 6, 2015 · 11 comments

Comments

@anthonydahanne
Copy link

By default, the rake job type appends a --silent
There's no way to remove this --silent option to the rake command see :
https://github.com/javan/whenever/blob/master/lib/whenever/setup.rb#L24
A workaround is to rather use a command job type.
I successfully replaced :

rake "-s sitemap:refresh:no_ping" , :environment => 'development'

with :

command "cd #{path} && #{environment_variable}=development #{bundle_command} rake sitemap:refresh:no_ping"

It effectively wrote to the crontab :

# Begin Whenever generated tasks for: trailerpark-dev
* * * * * /bin/bash -l -c 'cd /Users/anthony/workspaces/coreytrevor && RAILS_ENV=development bundle exec rake sitemap:refresh:no_ping >> /Users/anthony/workspaces/coreytrevor/cron_log 2>&1'

Now I can enjoy the output of the rake command in my log file :

In '/Users/anthony/workspaces/coreytrevor/public/':
+ sitemap.xml.gz                                        1718 links /    13.8 KB
Sitemap stats: 1,718 links / 1 sitemaps / 0m00s

IMHO , it makes no sense to append the --silent argument, since nothing prevents the user from using -s in its rake command

@jesus-sayar
Copy link

I have the same problem!

swapnilchincholkar added a commit to swapnilchincholkar/whenever that referenced this issue Feb 25, 2015
@ioquatix
Copy link

ioquatix commented May 5, 2015

+1

@JanaVPetrova
Copy link

+1
I faced the same issue!

@saidie
Copy link

saidie commented Jul 24, 2015

+1

3 similar comments
@peashutop
Copy link

+1

@vcavallo
Copy link

vcavallo commented Nov 9, 2015

+1

@bbergstrom
Copy link

+1

@allenfantasy
Copy link

+1 seriously.

@ioquatix
Copy link

why so serious

@javan
Copy link
Owner

javan commented May 26, 2016

You can always add your own type job for rake without the --silent option:

# schedule.rb
job_type :rake, "cd :path && :environment_variable=:environment :bundle_command rake :task :output"

@benlangfeld
Copy link
Collaborator

Closing because @javan's solution both works and is documented right there in the README. There is additionally a PR open to make this option directly configurable at #541. Please follow there for further discussion of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests