Aqui está o script:
#!/bin/bash
day="$(date '+%d')" # day=DD
moth="$(date '+%m')" # month=MM (i.e. 04) If do you want to use it by name (i.e. April), use B ('+%B'), to use it's abbreviation (i.e. Apr), use b ('+%b).
year="$(date '+%Y')" # year=YYYY, if do you want YY, then use lowercase y ('+%y')
path="history/$year/$month/$day" # path="/history/$year/$month/$day/"
cd /www # Change current directory to /www
echo mkdir -p "$path" # Create the directory.
echo mv public_html "$path" # Move the old data to the history
echo mv beta public_html # Rename beta to public_html
- Substitua
/www
pelo caminho base do seu servidor. - Substitua
public_html
pela pasta pública. - Substitua
beta
pela sua pasta beta.
Eu ecoei todas as linhas "sérias". Execute o programa.
Ele só irá ecoar os comandos, não executá-los.
Se tudo correr bem, remova todos os ecos da linha e comece de novo.