backup

Syntax error near unexpected token `newline' in cPanel

孤人 提交于 2021-01-29 20:08:07
问题 I am trying to back up my database in Laravel using Spatie package. Every thing worked fine till 31 Decemeber 2020 and in New Year my cron job stoped working. I don't know what happened, but on my cPanel mail I am receiving this email: /usr/local/cpanel/bin/jailshell: -c: line 0: syntax error near unexpected token `newline' /usr/local/cpanel/bin/jailshell: -c: line 0: `/usr/local/bin/php /home2/scoopscr/public_html/artisan backup:run 1>> ' and this is the cron job I am applying: /usr/local

Why is pg_restore segfaulting in Docker?

时光毁灭记忆、已成空白 提交于 2021-01-28 07:59:35
问题 I am testing a backup/restore procedure for my postgres DB inside a docker container. I dump my db like this: $ docker exec -ti my_postgres_container pg_dump -Fc -U postgres > db.dump Afterwards, I try to restore it like this: $ docker cp db.dump my_postgres_container:/db.dump $ docker exec -ti my_postgres_container pg_restore -U postgres -c -d postgres db.dump The command returns without output or errors, but nothing happens. So instead, I tried to restore it manually like this: $ docker cp

Why is SQL Server backup so much larger than the DB files?

北城以北 提交于 2021-01-21 06:20:14
问题 I have a SQL Server DB that is about 13Gb with a 1.6Gb log file. When I back it up, however, it creates a 50Gb .bak file! Why is that? I have read some commentary here about transaction logs, but my DB runs on my laptop and there is no DB activity during the time of the backup. (It only takes 5 minutes). My backup type is Full, my recovery type is Full, and I am doing Copy-Only backups. Any ideas? Much appreciated! I am using SQL 2008 R2, Developer Edition. 回答1: It might be because the backup

Why is SQL Server backup so much larger than the DB files?

眉间皱痕 提交于 2021-01-21 06:19:57
问题 I have a SQL Server DB that is about 13Gb with a 1.6Gb log file. When I back it up, however, it creates a 50Gb .bak file! Why is that? I have read some commentary here about transaction logs, but my DB runs on my laptop and there is no DB activity during the time of the backup. (It only takes 5 minutes). My backup type is Full, my recovery type is Full, and I am doing Copy-Only backups. Any ideas? Much appreciated! I am using SQL 2008 R2, Developer Edition. 回答1: It might be because the backup

Running artisan command from controller or route

帅比萌擦擦* 提交于 2020-12-31 05:59:33
问题 I use Spatie Laravel package I can take backup by running this command php artisan backup:run but I want to take back up form admin panel and running this command form controller, I create a route and controller and in the controller, I do this public function backup(){ \Artisan::call('backup:run'); return "successfully!"; } when I route to this finally I got the success message but in the backup file, nothing added. 回答1: You can put artisan command in sheduler. It will make back up for

How Do I Backup My PostgreSQL Database with Cron?

*爱你&永不变心* 提交于 2020-12-27 07:46:26
问题 I can run commands like vacuumdb, pg_dump, and psql just fine in a script if I preface them like so: /usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase > /opt/postgresql/prevac.gz /usr/bin/sudo -u postgres /usr/bin/vacuumdb --analyze mydatabase /usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase > /opt/postgresql/postvac.gz SCHEMA_BACKUP="/opt/postgresql/$(date +%w).db.schema" sudo -u postgres /usr/bin/pg_dump -C -s mydatabase > $SCHEMA_BACKUP These run at command line on Redhat

How Do I Backup My PostgreSQL Database with Cron?

两盒软妹~` 提交于 2020-12-27 07:46:13
问题 I can run commands like vacuumdb, pg_dump, and psql just fine in a script if I preface them like so: /usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase > /opt/postgresql/prevac.gz /usr/bin/sudo -u postgres /usr/bin/vacuumdb --analyze mydatabase /usr/bin/sudo -u postgres /usr/bin/pg_dump -Fc mydatabase > /opt/postgresql/postvac.gz SCHEMA_BACKUP="/opt/postgresql/$(date +%w).db.schema" sudo -u postgres /usr/bin/pg_dump -C -s mydatabase > $SCHEMA_BACKUP These run at command line on Redhat

Restore tablespace USERS doesn't work. Oracle backup

橙三吉。 提交于 2020-12-15 03:53:17
问题 I created a schema and my_table_test; ALTER SESSION SET CURRENT_SCHEMA=c##wojtek_admin; CREATE TABLE my_table_test ( id_test INT ); Then I created a backup using: BACKUP TABLESPACE USERS FORMAT 'c:\FRA\users%u'; Then I dropped my_table_test and run below commands: RMAN> RUN{ 2> SQL 'ALTER TABLESPACE USERS OFFLINE'; 3> RESTORE TABLESPACE USERS; 4> RECOVER TABLESPACE USERS; 5> SQL 'ALTER TABLESPACE USERS ONLINE'; 6> } Why my_table_test is dropped after I restored USERS TABLESPACE? 回答1: In a

Restore tablespace USERS doesn't work. Oracle backup

余生颓废 提交于 2020-12-15 03:53:04
问题 I created a schema and my_table_test; ALTER SESSION SET CURRENT_SCHEMA=c##wojtek_admin; CREATE TABLE my_table_test ( id_test INT ); Then I created a backup using: BACKUP TABLESPACE USERS FORMAT 'c:\FRA\users%u'; Then I dropped my_table_test and run below commands: RMAN> RUN{ 2> SQL 'ALTER TABLESPACE USERS OFFLINE'; 3> RESTORE TABLESPACE USERS; 4> RECOVER TABLESPACE USERS; 5> SQL 'ALTER TABLESPACE USERS ONLINE'; 6> } Why my_table_test is dropped after I restored USERS TABLESPACE? 回答1: In a

I can't restore tablespace. ORA-01539: tablespace '' is not online

依然范特西╮ 提交于 2020-12-15 03:52:35
问题 I try to create my first database backup. But it doesn't work. I don't know what I did wrong. Thanks in advance. Backup tablespace: BACKUP TABLESPACE USERS FORMAT 'c:\FRA\users%u'; My created backup tablespace: BS Key Type LV Size Device Type Elapsed Time Completion Time ------- ---- -- ---------- ----------- ------------ --------------- 5 Full 150.32M DISK 00:00:02 28-NOV-20 BP Key: 5 Status: AVAILABLE Compressed: NO Tag: TAG20201128T220319 Piece Name: C:\FRA\USERS05VGMFT7 List of Datafiles