Graph export deletes old export every time

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
G
Posts: 4
Joined: Fri Mar 19, 2010 9:22 am

Graph export deletes old export every time

Post by G »

Every time the graph export runs, it deletes the previous export, so if you look at the HTML pages during an export, they don't work. If you run an ls
during the export you'll see all the files get deleted and then slowly recreated during the export.

Using local filesystem export, not FTP. And the sanitize option isn't ticked for FTP.

Is this a bug or a feature?

Cacti 0.8.7e with all the latest patches installed.
G
Posts: 4
Joined: Fri Mar 19, 2010 9:22 am

Post by G »

I've found something interesting in graph_export.php:

del_directory($cacti_export_path, false);

I've commented this out to see if it stops cacti deleting all the graphs at the start of each export, but still works.
G
Posts: 4
Joined: Fri Mar 19, 2010 9:22 am

Post by G »

OK, with del_directory commented out, the export just doesn't work anymore. I assume that cacti won't overwrite existing files. Can this function be changed so instead of deleting and creating new files each time, it creates all the files with temporary file names and moves them over the old ones? This is much safer and won't leave the static html pages missing for minutes at a time on each graph export.
G
Posts: 4
Joined: Fri Mar 19, 2010 9:22 am

Post by G »

Actually, I was just impatient. With del_directory commented out, I now get the behaviour I want.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests