backup

How to install a bash function containing variables using a bash script? [duplicate]

走远了吗. 提交于 2019-12-02 10:33:46
This question already has an answer here: How to avoid heredoc expanding variables? [duplicate] 2 answers I am attempting to create a bash script that will allow me to install the same bash function across multiple machines. This particular function creates a copy of a file with a timestamp in a backup directory: filebackup () { cp "${@}" ~/"filebackup/${@}_$(date +%Y-%m-%d_%H:%M:%S).bk"; } Here is my bash script: cat <<EOT >> ~/.bashrc # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # create a file backup in ~/filebackup/ with timestamp filebackup () { cp "${@}

How copy data from one database to another on different server?

元气小坏坏 提交于 2019-12-02 09:57:41
问题 I have 2 DB with the same schema on different servers. I need to copy data from table T to the same table T in test database in different server and network. What is the easiest way to do it? I heard that data can be dumped to flat file and than inserted into database. How does it works? Can this be achieved using sqlplus and oracle database? Thank you! 回答1: Use Oracle export to export a whole table to a file, copy the file to serverB and import. http://www.orafaq.com/wiki/Import_Export_FAQ

Backup on File Close Excel VBA

╄→гoц情女王★ 提交于 2019-12-02 09:43:10
I want Excel to automatically backup a workbook on file close without prompts to the user. I found the excellent code below online (forgot source) but the backup FileType is changing to a BAK File that I cannot open. How do I fix this problem. Both files will be in the same folder & the backup should have same file name & "-bak" or ".bak". Sub SaveWorkbookBackup() Dim awb As Workbook, BackupFileName As String, i As Integer, OK As Boolean If TypeName(ActiveWorkbook) = "Nothing" Then Exit Sub Set awb = ActiveWorkbook If awb.Path = "" Then Application.Dialogs(xlDialogSaveAs).Show Else

Suggestions for backing up php site and mysql db

一曲冷凌霜 提交于 2019-12-02 08:53:38
问题 do you have any good suggestions how to backup remote php site and mysql, and upload it to another remote ftp? I do have shell access and it is linux system. Kind of lame question when I post it like that, but I assume some script would have to be run on remote server with site, that would do this. If you don't mind sharing your ideas, I would appreciate it. Best, Zeljko 回答1: Depends on the capabilities of your shell and the size of your site, but the first step could be very trivial: Use

Copy file as another name if file exist

我是研究僧i 提交于 2019-12-02 07:48:38
I want to copy specific file from pc to usb my code : xcopy /H /Y /C /R "C:\image1.jpeg" "G:\backup\image.jpeg" i want to do following : if G:\backup\image1.jpeg exist, copy image.jpeg as image2.jpeg (or as another name), if image2.jpeg exist, copy as image3.jpeg and ect.. Is it possible to do this? I'm going to assume your source name is "image.jpeg" and your destination has the appended suffix. I recommend putting a dot before the appended suffix to make it clear where the original name ends and the suffix begins. Your original name could already have a number at the end. Here is a crude but

How can I set up the working directory and the local repository on different drives?

北城余情 提交于 2019-12-02 07:14:31
In Git, how can I set up the working directory and the local repository on different drives? The reason being to back up code on every local commit. We employ a gatekeeper model on the 'master' repository, so I can't just push any old rubbish upstream, but I would like to ensure that any old rubbish is backed up every time I make a local commit. Use git init 's --separate-git-dir flag The git init command has a flag for that: --separate-git-dir=<git dir> Instead of initializing the repository as a directory to either $GIT_DIR or ./.git/ , create a text file there containing the path to the

commiting multiple folders in chronological order into git

岁酱吖の 提交于 2019-12-02 06:22:58
问题 I have several hundred backups of a web site, one per folder. I want to put them into a git repository, each backup as a version. The changes concern mostly image files and 2 database backups per day. The size is around 25 GB an increasing. Is there a way to tell git to take one of the folders and commit it into the repository, then take the next folder an commit the changes, until they are all commited? Or do I have to copy each folder into the first folder, commit and continue with next

How copy data from one database to another on different server?

旧时模样 提交于 2019-12-02 05:32:08
I have 2 DB with the same schema on different servers. I need to copy data from table T to the same table T in test database in different server and network. What is the easiest way to do it? I heard that data can be dumped to flat file and than inserted into database. How does it works? Can this be achieved using sqlplus and oracle database? Thank you! Use Oracle export to export a whole table to a file, copy the file to serverB and import. http://www.orafaq.com/wiki/Import_Export_FAQ You can use rsync to sync an oracle .dbf file or files to another server. This has problems and syncing all

Suggestions for backing up php site and mysql db

≯℡__Kan透↙ 提交于 2019-12-02 05:29:53
do you have any good suggestions how to backup remote php site and mysql, and upload it to another remote ftp? I do have shell access and it is linux system. Kind of lame question when I post it like that, but I assume some script would have to be run on remote server with site, that would do this. If you don't mind sharing your ideas, I would appreciate it. Best, Zeljko Depends on the capabilities of your shell and the size of your site, but the first step could be very trivial: Use mysqldump and zip it together with your webpage. For uploading your archive you can maybe use wput or simply

Microsoft Sql Server Managment studio backup size goes negative

[亡魂溺海] 提交于 2019-12-02 05:23:00
The problem is that I need to explain the different sizes of backups that are being made of a database in a plant. Sometimes the difference between the sizes is in negative, even though that there is no data being deleted from the system. Datum Backupfile-file Size KB Diff 6/1/10 backup201006010100.bak 3355914 7/1/10 backup201007010100.bak 4333367 977453 7/2/10 backup201007020100.bak 4355963 22596 7/3/10 backup201007030100.bak 4380896 24933 7/4/10 backup201007040100.bak 4380404 -492 8/1/10 backup201008010100.bak 4507775 1151861 8/2/10 backup201008020100.bak 4507777 2 8/3/10 backup201008030100