Results 1 to 6 of 6
-
07-08-2011, 18:48 #1
-= TeamSpeak Lover =-
- Join Date
- Jun 2011
- Location
- Baghdad, Iraq
- Posts
- 90
Using Snapshot scripts for daily backup ?
Hello
since i just fixed my server database and saved myself from a total remake of 74 channel and 13 group and lots of extra permissions -.-
i want to set the Snapshot pull script to automatic daily backup
but since am not experienced Linux shell user i need help with this
how can i set a script to auto run the
- Run every 24 hour.Code:./pullsnapshot.sh serveradmin 123213123ggadsa213 voice.teamspeak-systems.de 10011 backup.txt 1
- Set the backup.txt file name to something like backup_[date&time].txt.
- Store the backup files in specified folder.
so whats the best code / script to use ?
Thanks
-
08-08-2011, 00:07 #2
-= TeamSpeak Guru =-
- Join Date
- May 2010
- Posts
- 6,372
Hello
You can use this script :
About the path, you have to write the absolute path (not ./backup but /home/florian/backup)Code:#! /bin/sh #Path of the backup folder (absolute path) BACKUP_PATH=/home/florian/backup #Name of the snapshot file FILE_NAME=backup_`date +%Y-%m-%d_%H-%M-%S`.txt ./pullsnapshot.sh serveradmin florian 192.168.1.100 10011 ${FILE_NAME} 1 mv ./${FILE_NAME} ${BACKUP_PATH}/${FILE_NAME}
About the date format, for more information open the help : man date
How to use it :
- Put this script in the same place of the pullsnapshot.sh
- Add the exec right : chmod 744 cronsnapshot.sh
For test you can start it manualy : ./cronsnapshot.sh
Now to start it evry 24 hours :
For that you have to use the cron system (more info on google or man crontab)
- Open the cron tab : crontab -e
- Add this line : 0 0 * * * /home/florian/cronsnapshot.sh
0 0 to start script at midnight (0h00) You can chage for another specific hour
* * * for evry day, monthLast edited by florian_fr40; 12-08-2011 at 00:03.
-
11-08-2011, 00:12 #3
-= TeamSpeak Lover =-
- Join Date
- Jun 2011
- Location
- Baghdad, Iraq
- Posts
- 90
Thanks
-
11-08-2011, 19:04 #4
-= TeamSpeak Lover =-
- Join Date
- Jun 2011
- Location
- Baghdad, Iraq
- Posts
- 90
something is wrong here .. when i test the script i get
using Ubuntu serverCode:root@30003038:/home/teamspeak# sh ./cronsna.sh : not foundh: 2: : not foundh: 5: : not foundh: 8: : not foundh: 9: [: 80: 0: unexpected operator [: 80: 0: unexpected operator [: 80: 0: unexpected operator [: 80: 0: unexpected operator [: 80: 0: unexpected operator [: 80: 0: unexpected operator [: 80: 0: unexpected operator snapshot.txt file being written to as we speak? Something is very wrong here... exit: 80: Illegal number: -9 : not foundh: 11: mv: cannot move `./ts_backup_2011-08-11_18-01-42.txt\r' to `/home/teamspeak/backup\r/ts_backup_2011-08-11_18-01-42.txt\r\r': No such file or directory
cant move or even delete the backup.txt files
-
12-08-2011, 00:14 #5
-= TeamSpeak Guru =-
- Join Date
- May 2010
- Posts
- 6,372
I remade the script. It should work normaly now.
If you use Windows to download it before put it on Linux system, this can cause this problem.
Use wget on linux.Last edited by florian_fr40; 12-08-2011 at 11:13.
-
12-08-2011, 21:26 #6
-= TeamSpeak Lover =-
- Join Date
- Jun 2011
- Location
- Baghdad, Iraq
- Posts
- 90
What i did was edited the script added "bash" before the pull....sh
but still got errors when using crontab so fixed by adding the full path to the pullsnapshot.sh like :Code:#! /bin/sh #Path of the backup folder (absolute path) BACKUP_PATH=/home/teamspeak/backup #Name of the snapshot file FILE_NAME=backup_`date +%Y-%m-%d_%H-%M-%S`.txt bash ./pullsnapshot.sh serveradmin florian 192.168.1.100 10011 ${FILE_NAME} 1 mv ./${FILE_NAME} ${BACKUP_PATH}/${FILE_NAME}
and now it works like charmCode:bash /home/ahmed/backup/pullsnapshot.sh serveradmin florian 192.168.1.100 10011 ${FILE_NAME} 1
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
snapshot helper scripts
By Peter in forum Server SupportReplies: 25Last Post: 06-05-2013, 14:34 -
snapshot helper scripts
By Peter in forum Linux / FreeBSDReplies: 0Last Post: 08-02-2010, 15:47 -
Connection problems after daily IP reset
By GAGA Extrem in forum WindowsReplies: 0Last Post: 21-12-2009, 11:50 -
Crashing Daily
By Thalador in forum [TeamSpeak 2] Server SupportReplies: 4Last Post: 18-04-2005, 19:38


Reply With Quote