I am looking for some option in vi config options to set so that any time any user update/change any file then one backup file (before change) is created automatically which can be used for diff or to revert back during any issue of accidental or wrong update
I had heard some option to setup backupdir etc but not able to find the detail and not able to make it working on my unix box.
Could someone pls help me with command or steps to do it
Following are the 2 ways which you may try. 1st: You can create your .vimrcfile in your home directory.
example: Note: vim takes your .vimrc vim from your home directory. If you want backup file from VIM. use the above options in your .vimrc file. Double quote" is comment line in .vimrc file. So you can put any one of the above commands to set OR not to set backup. If you want to specify the backup files directory. Use the following way.
2nd: You can do a :w Input_file_bkp before start editing the original Input_file.
But obviously 1st option is much better than this.
I am looking for some option in vi config options to set so that any time any user update/change any file then one backup file (before change) is created automatically which can be used for diff or to revert back during any issue of accidental or wrong update
In a real vi there is no such option. There are many vi-clones out there (one being vim, which RavinderSingh13 already mentioned) which implement such a functionality, but the real vi doesn't.
The most obvious reason is that it is not needed: UNIX has a revision control system ("sccs", "Source Code Control System") built in which you could use to go back to an (in fact: any) earlier version. Many of todays UNIXes do not have sccs but one of its descendants: rcs, cvs, git, ... . If such a system is not already installed on your system it could be easily done so in a second, probably only install one or two packages and you are all set.
If you still want to do it without a version system: use a small script, which you can put into your path before vi, use an alias or whatever suits you:
hello guys
i need a script to automatically backup a whole directory in linux like
/var/www
and the whole sql db
and upload to an ftp server daily (as a cron job)
is there something like this? I read about rsync but I don't know if it will suit this. (6 Replies)
HI all, im new to shell scripting. need your guidence for my script. i wrote one script and is attached here
Im explaining the requirement of script.
AIM: Shell script to run automatically as per scheduled and backup few network devices configurations. Script will contain a set of commands... (4 Replies)
Hi Everyone,
we are running rsync with --backup mode, Are there any rsync options to remove backup folders on successful deployment?
Thanks in adv. (0 Replies)
Hi All,
I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by
set EDITOR=vi it does not open a vi editor , rather it do as below.....
/////////////////////////////////////////////////////
$ set... (6 Replies)
Hi,
I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question.
How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'?
As i see, p & P options does work only within 'vi'. (10 Replies)
Hi,
I performed backup on tape and I want to append more files to my previous backup on the same backup tape. But before I do that I need to know the backup file size of the first backup I performed so that I know the available size on the backup tape. Can someone help me what command I will use... (0 Replies)