New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Questions about tar and cron [SOLVED]
Hi.
I have 2 questions.
1.
tar -czvf /home/backups/raw/domain.com-`date '+%y%m%d_%H%M%S'`.tar.gz /home/nginx/domains/domain.com/
Right now when I open the compressed file the command above creates, its structure is
home --> nginx --> domain.com --> Content
I want it to just be
domain.com --> Content
But I can't figure out how to do that.
2.
Everyday after my cronjob runs I get an email that says
tar: Remove leading `/' from member names tar: Remove leading `/' from member names
I can never figure out what that means. Been happening for months lol.
Contents of my crontab -e
MAILTO="[email protected]" 0 0 * * * /root/tools/backup.sh > backups.log 0 0 * * * /usr/local/bin/php /home/nginx/domains/domain.com/private/cron.php > /tmp/script.out 2>&1
contents of backup.sh
mysqldump -u backup -pSECUREPASSWORDHERE dbname > /home/backups/raw/dbname-`date '+%y%m%d_%H%M%S'`.sql tar -czvf /home/backups/raw/domain.com-`date '+%y%m%d_%H%M%S'`.tar.gz ./home/nginx/domains/domain.com/ tar -czvf /home/backups/packed/domain.com-`date '+%y%m%d_%H%M%S'`.tar.gz /home/backups/raw rm -rf /home/backups/raw/* rsync -azP --remove-source-files /home/backups/packed/ backups@iphere:/home/backups/domain.com/
Any help would be greatly appreciated.
Comments
@NodeKid Thank you very much. Fixed all my issues.