Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7398107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:49:50+00:00 2026-05-29T03:49:50+00:00

I want to use chmod via capistrano to add permission for folder. For example,

  • 0

I want to use chmod via capistrano to add permission for folder. For example, i want to do that:

chmod 777 -R /vol/www/apps/ror_tutorial/current/log/

So, i want to do that via capistrano’s task. I tried that:

desc "Fix permission"
   task :fix_permissions, :roles => [ :app, :db, :web ] do
     run "#{try_sudo} chmod 777 -R #{current_path}/log"
   end

  after "deploy:update_code", :fix_permissions

But it doesn’t work. Permissions of the folder are same:

$ ls -alh /vol/www/apps/ror_tutorial/current/log/
total 1008K
drwxrwxrwx 2 root root 4.0K 2012-02-03 20:22 .
drwxrwxr-x 7 root root 4.0K 2012-01-25 20:50 ..
-rwxrwxrwx 1 root root 419K 2012-02-03 14:35 development.log
-rwxrwxrwx 1 root root 530K 2012-02-03 20:16 production.log
-rwxrwxrwx 1 root root    0 2012-02-02 14:21 searchd.development.pid
-rwxrwxrwx 1 root root  15K 2012-02-03 20:22 searchd.log
-rw------- 1 root root    6 2012-02-03 20:22 searchd.production.pid
-rwxrwxrwx 1 root root  19K 2012-02-03 18:07 searchd.query.log

If i try to print chmod manually via ssh it works:

$ chmod 777 -R /vol/www/apps/ror_tutorial/current/log/
$ ls -alh /vol/www/apps/ror_tutorial/current/log/
total 1008K
drwxrwxrwx 2 root root 4.0K 2012-02-03 20:22 .
drwxrwxr-x 7 root root 4.0K 2012-01-25 20:50 ..
-rwxrwxrwx 1 root root 419K 2012-02-03 14:35 development.log
-rwxrwxrwx 1 root root 530K 2012-02-03 20:16 production.log
-rwxrwxrwx 1 root root    0 2012-02-02 14:21 searchd.development.pid
-rwxrwxrwx 1 root root  15K 2012-02-03 20:22 searchd.log
-rwxrwxrwx 1 root root    6 2012-02-03 20:22 searchd.production.pid
-rwxrwxrwx 1 root root  19K 2012-02-03 18:07 searchd.query.log

How can i write right task for capistrano to do that?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:49:50+00:00Added an answer on May 29, 2026 at 3:49 am

    Try changing the hook to after deploy:symlink, I think you are updating permissions in the ‘previous’ current dir. On a side note: deploy:symlink will soon change to deploy:create_symlink, keep that in mind if this breaks after upgrading capistrano to 2.10 or higher.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After years of using chmod 777 to solve PHP write permission woes, I want
I have a transaction log file in CSV format that I want use to
I want to use the MultipleLookupField control in a web page that will run
I want use a typedef struct that isn't already defined, but it is later.
I want to use the octal permissions (used for chmod) for NSFilePosixPermissions. Here is
i want use XmlSampleGenerator API in my project. i don't know how to add
i want use single quotations inside a transact sql statement, then execute that statement.
I just installed XAMPP on OSX. I can't add folder on the htdocs via
I want use from multiple upload image in codeigniter but problem is here that
So I want use multiple div tags that use webkit borders but for some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.