How would I change the temporary dir that Capistrano uses?
Example: Instead of /tmp, I want to use /home/user/tmp
My current VPS has /tmp mounted as noexec, which gives me permission denied errors while trying to run cap production deploy.
To create new directory use "mkdir" command. For example, to create directory TMP in the current directory issue either "mkdir TMP" or "mkdir ./TMP". It's a good practice to organize files by creating directories and putting files inside of them instead of having all files in one directory.
Use mktemp -d . It creates a temporary directory with a random name and makes sure that file doesn't already exist.
The /tmp directory is a temporary landing place for files. Users also have write access to this directory, which can be a bad thing, but there is a solution.
In Unix and Linux, the global temporary directories are /tmp and /var/tmp. Web browsers periodically write data to the tmp directory during page views and downloads. Typically, /var/tmp is for persistent files (as it may be preserved over reboots), and /tmp is for more temporary files.
In Capistrano 3,
set :tmp_dir, '/home/user/tmp'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With