
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
Easy backup for Rails applications with PostgreSQL database.
Add this line into your application's Gemfile:
gem 'mypg'
Install the gem with Bundler:
$ bundle
And then add some settings:
$ rails g mypg:install
This will create a configuration file in config/mypg.yml
who looks like this:
# target_directory: '/path/to/backup'
# files_to_keep: 7
Just enter a valid directory to save your backup files.
Note: If not specified, the amount of files that will be saved is 7.
Go to your Rails root directory and run this:
$ rake db:backup RAILS_ENV=production
This command will create a .pgsql
file in the directory with your database's structure and data. Moreover, will delete the older files wich exceed the amount to be saved.
You can create automatic daily backups just setting up a task on Cron:
$ crontab -e
Insert this and save:
# m h dom mon dow command
0 0 * * * cd ~/my/rails/root && rake db:backup RAILS_ENV=production
With that, every day in the midnight (server's time) Cron will perform your backup task automatically.
If you wish to restore some saved backup, go to your Rails root directory and run this:
$ rake db:restore 'relative/target/directory/to/backup/database_x.pgsql' RAILS_ENV=production
This command will restructure the production database and restore all the data from backup file.
Note: The path for the backup file must be relative to the current directory in the console.
Leonardo Ávila for contributing in the README translation and revision.
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that mypg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.