
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Backup and restore your MySQL db and dependent local assets (e.g. PaperClip uploads)
The gem provides two rake tasks which will backup or restore a MySQL database along with any dependent file system assets (like uploaded files from PaperClip) into a single timestamped file.
Add rosie to your Gemfile:
gem 'rosie'
Use bundler to install it:
bundle install
If you're using Rails 2, you'll need to add a couple lines to your Rakefile
.
After all the requires, add the following:
require 'rosie'
Dir["#{Gem.searcher.find('rosie').full_gem_path}/lib/tasks/**/*.rake"].each { |ext| load ext }
Configuration values can be set by placing a rosie.yml file in your config directory. Default keys and values are as follows:
# sample rosie.yml
#
backup_dir:backups
assets_dirs:
- public/system
mysql_bin_dir:
prefix: my_app
backup_dir
: This specifies the directory where the backup files will be stored. It should be specified relative to your Rails root. This setting would give you #{Rails.root}/backups
.assets_dirs
: This specifies the directorys which hold system assets you want to be added to the backup file. All entries should be specified relative to your Rails root.mysql_bin_dir
: If mysql and mysqldump are not on the path of the user running this rake task, you may need to specify the directory where those commandline applications live. This should be an absolute path. By default, Rosie will try to find these in the user's PATH.prefix
: If specified, this provides a way to prefix your database backup files with an app (or other) name. If present, backup files will look like <my_app>_.tgz
The generated backup files (zipped tarballs) will be named by timestamp and placed in backup_dir
.After installing the gem as described above, add the rosie.yml file to your #{Rails.root}/config/ directory with settings appropriate to your app. The gem installs the following three tasks:
rosie:config
rosie:backup
rosie:restore
rosie:config
will show you what it's derived from your config.
% rake rosie:config
Rosie Config: read from /projects/boilerplate/config/rosie.yml
mysql: mysql
mysqldump: mysqldump
backup dir: /projects/boilerplate/my_backups
assets dirs: public/my_assets, public/my_other_assets
prefix: my_backup_file_prefix
If you've checked out the configuration, and things look good, you can run a backup like this:
% rake rosie:backup
You'll find a new file under your backups
dir (or whatever you've specified as the backup dir in your config).
To restore, run rosie:restore
. You'll need to add the commandline parameter datafile
to tell rosie which file you are trying to restore from.
For example: % rake rosie:restore datafile=~/Downloads/20110817180817.tgz
Rosie does not run migrations, so if you're pulling data from a database whose schema may be out of date with the system on which you're restoring, you probably will want to run a db:migrate after the restore.
Tested with Ruby 1.9.2-p180 on OSX 10.6/Ubuntu 10.10/11
Developed by Jon Rogers and Jeremy Yun @ 2rye.com Named after Rosie, the maid from the Jetsons (http://techland.time.com/2010/04/20/sci-fi-sexy-time-all-time-hottest-robots/500_rosie_jetsons/).
FAQs
Unknown package
We found that rosie demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.