Geek on the road

open source, open knowledge

RMbackups

| Comments

The first time I came up with this script was a long time ago and I did it with Perl. Today I feel like doing such a thing using Ruby.

Basically the script takes a number of directories and an optional pattern (last argument) from the command line. If either a directory or a pattern is not providen, it looks for in the current directory, and use a default pattern.

The script searches for those files matching the pattern and deletes thoses files from the system. Besides, it checks the owner of the files is the same that is running the script.

Liquid error: undefined method `Py_IsInitialized’ for RubyPython::Python:Module

The default pattern is set to delete backup files ending with ”~”. Below is the ouput:

Liquid error: undefined method `Py_IsInitialized’ for RubyPython::Python:Module

You might change the pattern from the command line:

Liquid error: undefined method `Py_IsInitialized’ for RubyPython::Python:Module

This is how it works, I did not try too many different patterns beyond these.

Comments