Skip to main content
added 2 characters in body
Source Link
user27807
user27807

I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday.

The problem I'm facing is how to rename the folder day by day according to date? Get the new name is easy, it's just

"/home/yzT/Backup yzT `date '+%b-%d-%Y'`%Y'`"

However how can I select the folder "Backup yzT Jan-01-2013" exactly? Because every day it will be different.

I've tried

mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT `date '+%b-%d-%Y'`

hoping that the mv path works like a regular expression, but sadly, it doesn't.

So how can I rename the folder?

I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday.

The problem I'm facing is how to rename the folder day by day according to date? Get the new name is easy, it's just

/home/yzT/Backup yzT `date '+%b-%d-%Y'`

However how can I select the folder "Backup yzT Jan-01-2013" exactly? Because every day it will be different.

I've tried

mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT `date '+%b-%d-%Y'`

hoping that the mv path works like a regular expression, but sadly, it doesn't.

So how can I rename the folder?

I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday.

The problem I'm facing is how to rename the folder day by day according to date? Get the new name is easy, it's just

"/home/yzT/Backup yzT `date '+%b-%d-%Y'`"

However how can I select the folder "Backup yzT Jan-01-2013" exactly? Because every day it will be different.

I've tried

mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT `date '+%b-%d-%Y'`

hoping that the mv path works like a regular expression, but sadly, it doesn't.

So how can I rename the folder?

added 19 characters in body
Source Link
Mat
  • 54.9k
  • 11
  • 164
  • 143

I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday.

The problem I'm facing is how to rename the folder day by day according to date? Get the new name is easy, it's just "/home/yzT/Backup yzT date '+%b-%d-%Y'.

/home/yzT/Backup yzT `date '+%b-%d-%Y'`

However how can I select the folder "Backup yzT Jan-01-2013" exactly? Because every day it will be different.

I've tried mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT date '+%b-%d-%Y'

mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT `date '+%b-%d-%Y'`

hoping that the mv path works like a regular expression, but sadly, it doesn't.

So how can I rename the folder?

I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday.

The problem I'm facing is how to rename the folder day by day according to date? Get the new name is easy, it's just "/home/yzT/Backup yzT date '+%b-%d-%Y'. However how can I select the folder "Backup yzT Jan-01-2013" exactly? Because every day it will be different.

I've tried mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT date '+%b-%d-%Y' hoping that the mv path works like a regular expression, but sadly, it doesn't.

So how can I rename the folder?

I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday.

The problem I'm facing is how to rename the folder day by day according to date? Get the new name is easy, it's just

/home/yzT/Backup yzT `date '+%b-%d-%Y'`

However how can I select the folder "Backup yzT Jan-01-2013" exactly? Because every day it will be different.

I've tried

mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT `date '+%b-%d-%Y'`

hoping that the mv path works like a regular expression, but sadly, it doesn't.

So how can I rename the folder?

Source Link
user27807
user27807

Help renaming folder according to date

I have the folder "Backup yzT Jan-01-2013". I've made also a script for do a backup everyday.

The problem I'm facing is how to rename the folder day by day according to date? Get the new name is easy, it's just "/home/yzT/Backup yzT date '+%b-%d-%Y'. However how can I select the folder "Backup yzT Jan-01-2013" exactly? Because every day it will be different.

I've tried mv "/home/yzT/Backup yzT *" "/home/yzT/Backup yzT date '+%b-%d-%Y' hoping that the mv path works like a regular expression, but sadly, it doesn't.

So how can I rename the folder?