Tuesday 20 August 2013

rm -rf does not delete folder contents but instead creates another empty one

rm -rf does not delete folder contents but instead creates another empty one

I'm currently writing a start script for a minecraft game server. In this
script I included a backup script.
This backup script works almost perfect but instead of deleting a folders
contents it just creates another one (similarilly named) and does not do
anything with the targeted folder.
I'm using this command: rm -rf "$MINECRAFT_PATH/server.log backups/*"
This command is executed in a bash script.
The variable $MINECRAFT_PATH does contain the correct path. The folder
created has this name: server.log.backups (Note the dot between log and
backups). But the targeted folder has this name: server.log backups. This
folder does exist and this is not the problem.

No comments:

Post a Comment